diff --git a/logv2.c b/logv2.c index 11096a28..9528f214 100644 --- a/logv2.c +++ b/logv2.c @@ -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); diff --git a/macro.c b/macro.c index a27a84fc..0adebdf7 100644 --- a/macro.c +++ b/macro.c @@ -1083,6 +1083,13 @@ int TclPublish(SConnection * pCon, SicsInterp * pSics, void *pData, Transact executes a command and sends a TRANSACTIONFINISHED string at the end. This is to permit clients to search for this string in order to find out when a command has finished. + + MK, May 2016 + + I changed this to write the TRANSACT strings only to the socket and not to the + log. Because this is clogging the log with useless stuff. If you want to + debug the protocol you still can sit on the line with sockspy. But I am unsure + of this change... */ @@ -1091,6 +1098,7 @@ int TransactAction(SConnection * pCon, SicsInterp * pSics, void *pData, int argc, char *argv[]) { char pBuffer[1024]; + char pStartBuffer[1088]; char *pCommand; int iRet; @@ -1101,11 +1109,12 @@ int TransactAction(SConnection * pCon, SicsInterp * pSics, void *pData, } strtolower(argv[0]); if (strcmp(argv[0], "fulltransact") == 0) { - SCPrintf(pCon, eLog, "TRANSACTIONSTART %s", pCommand); + snprintf(pStartBuffer, sizeof(pStartBuffer), "TRANSACTIONSTART %s", pCommand); + SCPureSockWrite(pCon, pStartBuffer,eLog); } iRet = InterpExecute(pSics, pCon, pCommand); if (pCommand != pBuffer) free(pCommand); - SCWrite(pCon, "TRANSACTIONFINISHED", eLog); + SCPureSockWrite(pCon, "TRANSACTIONFINISHED", eLog); return iRet; }