This is the first working version of the new logging system. Some work
in fine tuning still needs to be done. But is reasonably OK now.
This commit is contained in:
18
protocol.c
18
protocol.c
@ -12,9 +12,8 @@
|
||||
#include <conman.h>
|
||||
#include <fupa.h>
|
||||
#include <splitter.h>
|
||||
#include <outcode.c>
|
||||
#include <outcode.h>
|
||||
#include <dynstring.h>
|
||||
#include "commandlog.h"
|
||||
#include "protocol.h"
|
||||
#include <json/json.h>
|
||||
|
||||
@ -572,19 +571,12 @@ int SCWriteJSON_String(SConnection * pCon, char *pBuffer, int iOut)
|
||||
} else {
|
||||
iRet = 0;
|
||||
}
|
||||
snprintf(pBueffel,sizeof(pBueffel)-1, "Next line intended for socket: %d", iRet);
|
||||
SICSLogWrite(pBueffel, eInternal);
|
||||
SICSLogWrite(pBuffer, iOut);
|
||||
|
||||
/* write to commandlog if user or manager privilege */
|
||||
if (SCGetRights(pCon) <= usUser) {
|
||||
if (pCon->iMacro != 1) {
|
||||
WriteToCommandLogId(NULL, iRet, pBuffer);
|
||||
} else {
|
||||
if (iOut == eError || iOut == eWarning) {
|
||||
WriteToCommandLogId(NULL, iRet, pBuffer);
|
||||
}
|
||||
}
|
||||
if (SCGetRights(pCon) <= usUser && !SCinMacro(pCon)) {
|
||||
Log(INFO,"com","sock%03.3d:%s",iRet, pBuffer);
|
||||
} else {
|
||||
Log(DEBUG,"com","sock%03.3d:%s", iRet, pBuffer);
|
||||
}
|
||||
|
||||
if (SCinMacro(pCon)) {
|
||||
|
Reference in New Issue
Block a user