X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Kernel%2Flogging.c;h=17888a712dbd013a0ac62c36f1e9c45338c27e78;hb=9d85201216cb35e1b1e051b1d7cdc38eaa5befa4;hp=225ce53e89884a91f04ef52a949c82446c44068e;hpb=7d881c2e5fef91a6570e46ef69a5d4a5cf0e8b4d;p=tpg%2Facess2.git diff --git a/Kernel/logging.c b/Kernel/logging.c index 225ce53e..17888a71 100644 --- a/Kernel/logging.c +++ b/Kernel/logging.c @@ -47,15 +47,15 @@ typedef struct sLogList } tLogList; // === PROTOTYPES === -void Log_AddEvent(char *Ident, int Level, char *Format, va_list Args); +void Log_AddEvent(const char *Ident, int Level, const char *Format, va_list Args); static void Log_Int_PrintMessage(tLogEntry *Entry); -void Log_KernelPanic(char *Ident, char *Message, ...); -void Log_Panic(char *Ident, char *Message, ...); -void Log_Error(char *Ident, char *Message, ...); -void Log_Warning(char *Ident, char *Message, ...); -void Log_Notice(char *Ident, char *Message, ...); -void Log_Log(char *Ident, char *Message, ...); -void Log_Debug(char *Ident, char *Message, ...); +//void Log_KernelPanic(const char *Ident, const char *Message, ...); +//void Log_Panic(const char *Ident, const char *Message, ...); +//void Log_Error(const char *Ident, const char *Message, ...); +//void Log_Warning(const char *Ident, const char *Message, ...); +//void Log_Notice(const char *Ident, const char *Message, ...); +//void Log_Log(const char *Ident, const char *Message, ...); +//void Log_Debug(const char *Ident, const char *Message, ...); // === EXPORTS === EXPORT(Log_Panic); @@ -80,7 +80,7 @@ tLogList gLog_Levels[NUM_LOG_LEVELS]; /** * \brief Adds an event to the log */ -void Log_AddEvent(char *Ident, int Level, char *Format, va_list Args) +void Log_AddEvent(const char *Ident, int Level, const char *Format, va_list Args) { int len; tLogEntry *ent; @@ -102,6 +102,7 @@ void Log_AddEvent(char *Ident, int Level, char *Format, va_list Args) #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 ); @@ -110,6 +111,8 @@ void Log_AddEvent(char *Ident, int Level, char *Format, va_list Args) { #define LOG_HDR_LEN (14+1+2+8+2) char newData[ LOG_HDR_LEN + len + 2 + 1 ]; + char _ident[9]; + strncpy(_ident, Ident, 9); sprintf( newData, "%014lli%s [%+8s] ", ent->Time, csaLevelCodes[Level], Ident); strcpy( newData + LOG_HDR_LEN, ent->Data ); @@ -163,7 +166,7 @@ void Log_Int_PrintMessage(tLogEntry *Entry) /** * \brief KERNEL PANIC!!!! */ -void Log_KernelPanic(char *Ident, char *Message, ...) +void Log_KernelPanic(const char *Ident, const char *Message, ...) { va_list args; va_start(args, Message); @@ -174,7 +177,7 @@ void Log_KernelPanic(char *Ident, char *Message, ...) /** * \brief Panic Message - Driver Unrecoverable error */ -void Log_Panic(char *Ident, char *Message, ...) +void Log_Panic(const char *Ident, const char *Message, ...) { va_list args; va_start(args, Message); @@ -185,7 +188,7 @@ void Log_Panic(char *Ident, char *Message, ...) /** * \brief Error Message - Recoverable Error */ -void Log_Error(char *Ident, char *Message, ...) +void Log_Error(const char *Ident, const char *Message, ...) { va_list args; va_start(args, Message); @@ -196,7 +199,7 @@ void Log_Error(char *Ident, char *Message, ...) /** * \brief Warning Message - Something the user should know */ -void Log_Warning(char *Ident, char *Message, ...) +void Log_Warning(const char *Ident, const char *Message, ...) { va_list args; @@ -208,7 +211,7 @@ void Log_Warning(char *Ident, char *Message, ...) /** * \brief Notice Message - Something the user might like to know */ -void Log_Notice(char *Ident, char *Message, ...) +void Log_Notice(const char *Ident, const char *Message, ...) { va_list args; va_start(args, Message); @@ -219,7 +222,7 @@ void Log_Notice(char *Ident, char *Message, ...) /** * \brief Log Message - Possibly useful information */ -void Log_Log(char *Ident, char *Message, ...) +void Log_Log(const char *Ident, const char *Message, ...) { va_list args; va_start(args, Message); @@ -230,7 +233,7 @@ void Log_Log(char *Ident, char *Message, ...) /** * \brief Debug Message - Only a developer would want this info */ -void Log_Debug(char *Ident, char *Message, ...) +void Log_Debug(const char *Ident, const char *Message, ...) { va_list args; va_start(args, Message);