Changeset 748
- Timestamp:
- 07/08/08 15:42:38 (5 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/fs/kernel/print.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/fs/kernel/print.c
r559 r748 17 17 */ 18 18 19 #include <config.h> 19 20 #include <module.h> 20 21 #include <stdarg.h> … … 31 32 SYMBOL_EXPORT(KeSetOutput); 32 33 34 int logLevelUnknown=1; 35 int currLogLevel=-1; 36 33 37 void KePrint(const char* message, ...) 34 38 { 35 char buf[2048]; 36 int length; 39 char buf[1024]; 40 char outputBuf[1024]; 41 char* start; 42 int length=0; 37 43 va_list args; 38 44 … … 41 47 va_end(args); 42 48 43 ConsoleOutput(buf, length); 49 length=0; 50 51 for (start=buf; *start; start++) 52 { 53 if (logLevelUnknown) 54 { 55 /* Parse the beginning of the message to find out the log level. */ 56 if (*start == '<') 57 { 58 currLogLevel=*(start+1)-'0'; 59 60 /* Skip past the closing > */ 61 start+=3; 62 }else 63 currLogLevel=1; 64 65 logLevelUnknown=0; 66 } 67 68 if (currLogLevel <= KERN_LOG_LEVEL) 69 outputBuf[length++]=*start; 70 71 if (*start == '\n') 72 logLevelUnknown=1; 73 } 74 75 outputBuf[length]='\0'; 76 77 ConsoleOutput(outputBuf, length); 44 78 } 45 79