summaryrefslogtreecommitdiff
path: root/src/main/WarnLevel.c
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-05-07 17:03:54 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-05-07 17:03:54 +0000
commitb43ef45baf339254c14bab555745320be213a2a0 (patch)
treeef96ce87a05145e63465f1ba30fc5009af7815d9 /src/main/WarnLevel.c
parentaefdd2eca50465c38e738f820fa501f3218f5602 (diff)
Add processor number to warnings (Cactus/635)
Tidying of warnings given by warnings routines Always give full information for a terminal warning git-svn-id: http://svn.cactuscode.org/flesh/trunk@2154 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/WarnLevel.c')
-rw-r--r--src/main/WarnLevel.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/main/WarnLevel.c b/src/main/WarnLevel.c
index 6bd70c06..fa145589 100644
--- a/src/main/WarnLevel.c
+++ b/src/main/WarnLevel.c
@@ -288,25 +288,26 @@ int CCTK_VWarn (int level,
{
CCTK_INT *cctk_full_warnings;
int param_type;
-
-
+ int myproc;
va_list ap;
if (level <= warning_level)
{
+ myproc = CCTK_MyProc(NULL);
+
cctk_full_warnings = (CCTK_INT *) CCTK_ParameterGet ("cctk_full_warnings",
"Cactus",
&param_type);
- if (cctk_full_warnings && *cctk_full_warnings)
+ if ((level <= error_level) || (*cctk_full_warnings && cctk_full_warnings))
{
- fprintf (stderr, "WARNING level %d in thorn %s\n"
+ fprintf (stderr, "WARNING level %d in thorn %s processor %d\n"
" (line %d of %s): \n"
" -> ",
- level, thorn, line, file);
+ level, thorn, myproc, line, file);
}
else
{
- fprintf (stderr, "WARNING[%d] (%s): ", level, thorn);
+ fprintf (stderr, "WARNING[L%d,P%d] (%s): ", level, myproc, thorn);
}
va_start (ap, format);
@@ -507,12 +508,11 @@ int CCTKi_SetWarnLevel (int level)
}
else
{
- CCTK_VWarn (3, __LINE__, __FILE__, "Cactus",
+ CCTK_VInfo ("Cactus",
"Warning level is already %d", level);
retval = 0;
}
- /* FIXME Is this right? Gab. */
if (warning_level < error_level)
{
error_level = warning_level;
@@ -531,7 +531,7 @@ int CCTKi_SetWarnLevel (int level)
@desc
Sets the error level
@enddesc
- @calls CCTK_VWarn
+ @calls CCTK_VWarn
CCTK_VInfo
@var level
@@ -551,7 +551,6 @@ int CCTKi_SetErrorLevel (int level)
{
int retval;
-
if (level <= warning_level)
{
if (error_level != level)
@@ -570,9 +569,12 @@ int CCTKi_SetErrorLevel (int level)
}
else
{
- CCTK_VWarn (1, __LINE__, __FILE__, "Cactus",
- "Error level cannot be higher than current warning level %d",
- warning_level);
+ retval = level > error_level ? +1 : -1;
+ error_level = level;
+ CCTK_VInfo ("Cactus",
+ "Increasing warning level from %d to match error level %d",
+ warning_level,error_level);
+ warning_level = level;
retval = 0;
}