Further enhancements to the new logging system

I removed traceCommand because I needed a more fine grained control of what goes into
the log.
This commit is contained in:
2016-03-01 09:42:16 +01:00
parent 0da0380c8a
commit 40382b2b8c
9 changed files with 60 additions and 191 deletions

16
logv2.h
View File

@ -57,6 +57,13 @@ typedef void (*LogCallback)(unsigned int severity, const char *timeStamp,
void RegisterLogCallback(LogCallback func, void *userData);
void RemoveLogCallback(LogCallback func);
/* test if this log entry is filtered. Made a part of the API in support of
* log listeners
* \param severity the severity of the message
* \param subsystem the subsystem of the message
* \return 1 when filtered, 0 else
*/
unsigned int logFilter(unsigned int severity, const char *subsystem);
/*
*Disable logging in support of the nolog option in SICSmain.c
*/
@ -66,4 +73,13 @@ void DisableLog(void);
*/
void LogClose(void *data);
/*
* internal use in other logging functions
* \param severity The severity to encode
* \param buffer The buffer to write the severity as text too
* \param bufferLengh The length of buffer in order to prevent buffer overwrites
*/
void formatSeverity(unsigned int severity,
char *buffer, unsigned int bufferLength);
#endif