Added sicsdebug flag to control verbosity of log files.
If sicsdebug == 0 log output from commands executed in macros is suppressed.
This commit is contained in:
21
conman.c
21
conman.c
@ -73,6 +73,7 @@
|
|||||||
#include "statusfile.h"
|
#include "statusfile.h"
|
||||||
#include "sicshipadaba.h"
|
#include "sicshipadaba.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
|
#include "sicsvar.h"
|
||||||
/*
|
/*
|
||||||
#define UUDEB 1
|
#define UUDEB 1
|
||||||
define UUDEB , for buffer writing for checking encoding */
|
define UUDEB , for buffer writing for checking encoding */
|
||||||
@ -107,6 +108,24 @@ struct SCStore {
|
|||||||
long macroStack;
|
long macroStack;
|
||||||
commandContext cc;
|
commandContext cc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This will return the value of a SICS int variable called "sicsdebug"
|
||||||
|
* If sicsdebug is not defined it will return 1
|
||||||
|
* TODO Maybe define debugging levels.
|
||||||
|
*
|
||||||
|
* return 0=debug off, 1=debug on or sicsdebug not defined.
|
||||||
|
*/
|
||||||
|
int sicsdebug() {
|
||||||
|
pSicsVariable debug;
|
||||||
|
|
||||||
|
debug = FindVariable(pServ->pSics, "sicsdebug");
|
||||||
|
if (debug) {
|
||||||
|
return debug->iVal;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
static char *ConName(long ident)
|
static char *ConName(long ident)
|
||||||
{
|
{
|
||||||
@ -765,7 +784,7 @@ int SCNormalWrite(SConnection * self, char *buffer, int iOut)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* log it for any case */
|
/* log it for any case */
|
||||||
if (!(iOut == eInternal
|
if ( (sicsdebug() || !SCinMacro(self)) && !(iOut == eInternal
|
||||||
|| (buffer[0] == 'O' && buffer[1] == 'K'
|
|| (buffer[0] == 'O' && buffer[1] == 'K'
|
||||||
&& (buffer[2] == '\0' || buffer[2] == '\r' || buffer[2] == '\n'))))
|
&& (buffer[2] == '\0' || buffer[2] == '\r' || buffer[2] == '\n'))))
|
||||||
SICSLogWrite(buffer, iOut);
|
SICSLogWrite(buffer, iOut);
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
# Author: Ferdi Franceschini (ffr@ansto.gov.au)
|
||||||
|
|
||||||
#set sicsroot /usr/local/sics
|
#set sicsroot /usr/local/sics
|
||||||
|
VarMake sicsdebug Int Mugger
|
||||||
|
sicsdebug 0
|
||||||
|
|
||||||
VarMake opal_simulation Text internal
|
VarMake opal_simulation Text internal
|
||||||
|
|
||||||
opal_simulation true
|
opal_simulation true
|
||||||
|
Reference in New Issue
Block a user