Added hex logging back again.

Added it back in in AsyncQueue
This commit is contained in:
2016-03-14 09:43:27 +01:00
parent ac2d66c61e
commit 18816067db
5 changed files with 130 additions and 7 deletions

17
logv2.c
View File

@ -15,6 +15,7 @@
#include <lld_str.h>
#include <lld.h>
#include <dynstring.h>
#include <hexString.h>
/*==============================================================================
some static fields which control log file rotation
===============================================================================*/
@ -456,6 +457,22 @@ void LogTS(struct timeval *tv, unsigned int severity, unsigned int subsystem,con
}
}
/*----------------------------------------------------------------------------*/
void LogHex(struct timeval*tv, unsigned int severity, unsigned int subsystem,
char *buffer, int bufferLength)
{
char subText[30], timeStamp[256], *hexData;
formatSubsystem(subsystem,subText,sizeof(subText));
formatTimeStamp(tv, timeStamp,sizeof(timeStamp),0);
hexData = bytesToHexString((uint8_t *)buffer,(size_t)bufferLength);
if(hexData != NULL){
LogInternal((char *)timeStamp, severity, subText,hexData);
free(hexData);
}
}
/*----------------------------------------------------------------------------*/
void Log(unsigned int severity, const char *subsystem,const char *format,...)