EXPORT(Log_Debug);
// === GLOBALS ===
-tSpinlock glLog;
-tSpinlock glLogOutput;
+tShortSpinlock glLogOutput;
#if USE_RING_BUFFER
Uint8 gaLog_RingBufferData[sizeof(tRingBuffer)+RING_BUFFER_SIZE];
tRingBuffer *gpLog_RingBuffer = (void*)gaLog_RingBufferData;
#else
+tMutex glLog;
tLogList gLog;
tLogList gLog_Levels[NUM_LOG_LEVELS];
#endif
#endif
ent->Time = now();
strncpy(ent->Ident, Ident, 8);
+ ent->Ident[8] = '\0';
ent->Level = Level;
ent->Length = len;
vsnprintf( ent->Data, len+1, Format, Args );
RingBuffer_Write( gpLog_RingBuffer, newData, LOG_HDR_LEN + len + 2 );
}
#else
- LOCK( &glLog );
+ Mutex_Acquire( &glLog );
ent->Next = gLog.Tail;
if(gLog.Head)
else
gLog_Levels[Level].Tail = gLog_Levels[Level].Head = ent;
- RELEASE( &glLog );
+ Mutex_Release( &glLog );
#endif
#if PRINT_ON_APPEND
*/
void Log_Int_PrintMessage(tLogEntry *Entry)
{
- //LOCK( &glLogOutput );
+ SHORTLOCK( &glLogOutput );
LogF("%s%014lli%s [%+8s] %s\x1B[0m\r\n",
csaLevelColours[Entry->Level],
Entry->Time,
Entry->Ident,
Entry->Data
);
- //RELEASE( &glLogOutput );
+ SHORTREL( &glLogOutput );
}
/**