DiskTool - Compiling again, now with modules
[tpg/acess2.git] / Tools / DiskTool / src / logging.c
1 /*
2  * 
3  */
4 #include <stdio.h>
5 #include <stdarg.h>
6 #include <stdlib.h>
7 #include <acess_logging.h>
8
9 #define PUTERR(col,type)        {\
10         fprintf(stderr, "\e["col"m[%-8.8s]"type" ", Ident); \
11         va_list args; va_start(args, Message);\
12         vfprintf(stderr, Message, args);\
13         va_end(args);\
14         fprintf(stderr, "\e[0m\n"); \
15 }
16
17 // === CODE ===
18 void Log_KernelPanic(const char *Ident, const char *Message, ...) {
19         PUTERR("35", "k")
20         exit(-1);
21 }
22 void Log_Panic(const char *Ident, const char *Message, ...)
23         PUTERR("34", "p")
24 void Log_Error(const char *Ident, const char *Message, ...)
25         PUTERR("31", "e")
26 void Log_Warning(const char *Ident, const char *Message, ...)
27         PUTERR("33", "w")
28 void Log_Notice(const char *Ident, const char *Message, ...)
29         PUTERR("32", "n")
30 void Log_Log(const char *Ident, const char *Message, ...)
31         PUTERR("37", "l")
32 void Log_Debug(const char *Ident, const char *Message, ...)
33         PUTERR("37", "d")
34
35 void Warning(const char *Message, ...) {
36         const char *Ident = "WARNING";
37         PUTERR("33", "W")
38 }
39 void Log(const char *Message, ...) {
40         const char *Ident = "LOGLOG";
41         PUTERR("37", "L")
42 }
43
44 void Debug_HexDump(const char *Prefix, size_t Length, const void *Data)
45 {
46
47 }
48

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