1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
void LogMsgBuffers(message_id_type msgID, int32 numPairs, ...)
{
va_list arguments;
va_start(arguments, numPairs);
filter_status_type msgStatus = FilterMsg(msgID);
if (msgStatus == FILTER_ACCEPT)
{
LogMsg(msgID, numPairs, arguments);
}
if ((_parentLogger != NULL) && (_oAppenderInheritance))
{
//Pass the msg to the parent
_parentLogger->LogMsgBuffersV(msgID, numPairs, arguments);
}
return;
}
void LogMsgBuffersV(message_id_type msgID, int32 numPairs, va_list arguments)
{
filter_status_type msgStatus = FilterMsg(msgID);
if (msgStatus == FILTER_ACCEPT)
{
//Log msg to the current node
LogMsg(msgID, numPairs, arguments);
}
if ((_parentLogger != NULL) && (_oAppenderInheritance))
{
//Pass the msg to the parent
_parentLogger->LogMsgBuffersV(msgID, numPairs, arguments);
}
return;
}
void LogMsgBuffersV(message_id_type msgID, int32 numPairs, va_list arguments)
{
filter_status_type msgStatus = FilterMsg(msgID);
if (msgStatus == FILTER_ACCEPT)
{
//Log msg to the current node
LogMsg(msgID, numPairs, arguments);
}
if ((_parentLogger != NULL) && (_oAppenderInheritance))
{
//Pass the msg to the parent
_parentLogger->LogMsgBuffersV(msgID, numPairs, arguments);
}
return;
}
void LogMsg(message_id_type msgID, int32 numPairs, va_list arguments)
{
uint32 i;
for (i = 0; i < _pOwnAppenderVec.size(); i++)
{
LoggerAppender *appender = _pOwnAppenderVec[i];
appender->AppendBuffers(msgID, numPairs, arguments);
}
return;
}
void AppendBuffers(message_id_type msgID, int32 numPairs, va_list va)
{
for (int32 i = 0; i < numPairs; i++)
{
int32 length = va_arg(va, int32);
uint8* buffer = va_arg(va, uint8*);
int32 jj;
for (jj = 10; jj < length; jj += 10)
{
AppendStringA(0, " %x %x %x %x %x %x %x %x %x %x", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7], buffer[8], buffer[9]);
buffer += 10;
}
uint8 remainderbuf[10];
uint32 remainder = length - (jj - 10);
if (remainder > 0 && remainder <= 10)
{
oscl_memcpy(remainderbuf, buffer, remainder);
oscl_memset(remainderbuf + remainder, 0, 10 - remainder);
buffer = remainderbuf;
AppendStringA(0, " %x %x %x %x %x %x %x %x %x %x", buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7], buffer[8], buffer[9]);
}
}
va_end(va);
}
|