Changes to logging
Add 'L' to 'M', 'N', 'D' log flags (for consistency) Replace colon (':') in logfilenames with minus ('-') Suppress spurious blank lines in logfile from line terminators Add filename to open/close messages for chaining convenience
This commit is contained in:
19
conman.c
19
conman.c
@ -789,17 +789,17 @@ static int isOK(const char *buffer)
|
||||
/*--------------------------------------------------------------------------*/
|
||||
static void testAndWriteSICSLog(SConnection * self, char *buffer, int iOut)
|
||||
{
|
||||
char *tp;
|
||||
char tp;
|
||||
/* We don't want to log the "OK" messages */
|
||||
if (isOK(buffer))
|
||||
return;
|
||||
|
||||
if (SCinMacro(self)) {
|
||||
tp = "M";
|
||||
tp = 'M';
|
||||
if (sicsdebug())
|
||||
tp = "D";
|
||||
tp = 'D';
|
||||
} else
|
||||
tp = "N";
|
||||
tp = 'N';
|
||||
switch (iOut) {
|
||||
case eStatus:
|
||||
case eStart:
|
||||
@ -812,22 +812,25 @@ static void testAndWriteSICSLog(SConnection * self, char *buffer, int iOut)
|
||||
case eError:
|
||||
case eWarning:
|
||||
/* Log it */
|
||||
SICSLogPrintf(iOut, "%s:%s", tp, buffer);
|
||||
SICSLogWriteCode(buffer, iOut, tp);
|
||||
return;
|
||||
case eValue:
|
||||
if (sicsdebug() || !SCinMacro(self)) {
|
||||
/* Log it */
|
||||
SICSLogPrintf(iOut, "%s:%s", tp, buffer);
|
||||
SICSLogWriteCode(buffer, iOut, tp);
|
||||
return;
|
||||
} else {
|
||||
/* Suppressed */
|
||||
/* SICSLogPrintf(iOut, "%s!:%s", tp, buffer); */
|
||||
#if 0
|
||||
tp = tolower(tp);
|
||||
SICSLogWriteCode(buffer, iOut, tp);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("Unrecognized ouput code %d in testAndWriteSICSLog: FIXME!!!\n", iOut);
|
||||
SICSLogPrintf(iOut, "%s:%s", tp, buffer);
|
||||
SICSLogWriteCode(buffer, iOut, tp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user