8 #include <acess_logging.h>
10 #define PUTERR(col,type) {\
11 fprintf(stderr, "\e["col"m[%-8.8s]"type" ", Ident); \
12 va_list args; va_start(args, Message);\
13 vfprintf(stderr, Message, args);\
15 fprintf(stderr, "\e[0m\n"); \
19 void Log_KernelPanic(const char *Ident, const char *Message, ...) {
23 void Log_Panic(const char *Ident, const char *Message, ...)
25 void Log_Error(const char *Ident, const char *Message, ...)
27 void Log_Warning(const char *Ident, const char *Message, ...)
29 void Log_Notice(const char *Ident, const char *Message, ...)
31 void Log_Log(const char *Ident, const char *Message, ...)
33 void Log_Debug(const char *Ident, const char *Message, ...)
36 void Warning(const char *Message, ...) {
37 const char *Ident = "";
40 void Log(const char *Message, ...) {
41 const char *Ident = "";
45 void Debug_HexDump(const char *Prefix, const void *Data, size_t Length)
47 const uint8_t *data = Data;
49 fprintf(stderr, "[HexDump ]d %s: %i bytes\n", Prefix, (int)Length);
50 for( ofs = 0; ofs + 16 <= Length; ofs += 16 )
52 fprintf(stderr, "[HexDump ]d %s:", Prefix);
53 fprintf(stderr, " %02x %02x %02x %02x %02x %02x %02x %02x",
54 data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
56 fprintf(stderr, " %02x %02x %02x %02x %02x %02x %02x %02x",
57 data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
59 fprintf(stderr, "\n");
62 fprintf(stderr, "[HexDump ]d %s:", Prefix);
63 for( ; ofs < Length; ofs ++ )
65 if( ofs % 16 == 8 ) fprintf(stderr, " ");
66 fprintf(stderr, " %02x", data[ofs%16]);
68 fprintf(stderr, "\n");