Kernel/VFS - Better error reporting in open
[tpg/acess2.git] / KernelLand / Kernel / logging.c
index 2905dd1..3ccfef2 100644 (file)
@@ -29,7 +29,10 @@ const char   *csaLevelColours[] = {
                "\x1B[35m", "\x1B[34m", "\x1B[36m", "\x1B[31m",
                "\x1B[33m", "\x1B[32m", "\x1B[0m", "\x1B[0m"
                };
-const char     *csaLevelCodes[] =  {"k","p","f","e","w","n","l","d"};
+const char     *csaLevelCodes[] =  {
+               "k","p","f","e",
+               "w","n","l","d"
+               };
 
 // === TYPES ===
 typedef struct sLogEntry
@@ -155,18 +158,18 @@ void Log_Int_PrintMessage(tLogEntry *Entry)
        if( CPU_HAS_LOCK(&glLogOutput) )
                return ;        // TODO: Error?
        SHORTLOCK( &glLogOutput );
-       LogF("%s%014lli",
+       bool completed = LogF(
+               "%s%014lli%s [%-8s] %i - %.*s\x1B[0m\r\n",
                csaLevelColours[Entry->Level],
-               Entry->Time
-               );
-       LogF("%s [%-8s] %i - %.*s",
+               Entry->Time,
                csaLevelCodes[Entry->Level],
                Entry->Ident,
                Threads_GetTID(),
                Entry->Length,
                Entry->Data
                );
-       LogF("\x1B[0m\r\n");    // Separate in case Entry->Data is too long
+       if( !completed )
+               LogF("\x1B[0m\r\n");    // Separate in case Entry->Data is too long
        SHORTREL( &glLogOutput );
 }
 

UCC git Repository :: git.ucc.asn.au