Removed the suppression list again from logv2.c for fear of performance issues.

I rather implemented the suppression of TRANSACT messages in macro.c
This commit is contained in:
2016-05-18 11:58:52 +02:00
parent 1f23c19e1c
commit 294195c872
2 changed files with 14 additions and 28 deletions

29
logv2.c
View File

@ -32,8 +32,6 @@ static unsigned int globalLogLevel = INFO;
/*========= The list of sub systems for which full logging is enabled ==========*/
unsigned int logEnabledArray[MAXSUB ];
/*========== A list of entries to suppress =====================================*/
int suppressList;
/*================== Callback management =======================================*/
typedef struct {
@ -256,15 +254,10 @@ unsigned int logFilter(unsigned int severity, const char *subsystem, const char
}
/*
test if it is in the suppression list
suppress empty messages
*/
status = LLDnodePtr2First(suppressList);
while (status == 1) {
LLDstringData(suppressList, buffer);
if(strstr(logMessage,buffer) != NULL){
return 1;
}
status = LLDnodePtr2Next(suppressList);
if(strlen(logMessage) < 1) {
return 1;
}
@ -669,21 +662,6 @@ static int LogConfigAction(SConnection * pCon, SicsInterp * pSics,
SCWrite(pCon,GetCharArray(result),eValue);
DeleteDynString(result);
}
}else if (strcmp(argv[1],"suppress") == 0) {
if(argc > 2){
/*
The 1024 is related to the size of the buffer in logFilter
*/
if(strlen(argv[2]) >= 1024) {
SCWrite(pCon,"ERROR: string to suppress to long",eError);
return 0;
}
LLDstringAppend(suppressList,argv[2]);
SCSendOK(pCon);
} else {
SCWrite(pCon,"ERROR: need text to suppress",eError);
return 0;
}
} else {
SCPrintf(pCon,eError,"ERROR: unknown keyword %s",argv[1]);
return 0;
@ -702,7 +680,6 @@ void Logv2Init(void)
int i;
callbackList = LLDcreate(sizeof(LogCBData));
suppressList = LLDstringCreate();
strcpy(logTemplate,"unconfiguredLogTemplate");
AddCmd("log", LogAction);