summaryrefslogtreecommitdiff
path: root/lib/logger/log.c
blob: fd226e5b31b39082156d176a7f2a99099bd4fea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "log.h"
#include <stdarg.h>

void PutConsole(char *str, int color, va_list va);

void log(char *module_name, int log_level, char *format_string, ...)
{

    if(log_level<FOOLOS_LOG_INFO)return;

    PutConsole(module_name,0b1111100000000000,0);
    PutConsole(": ",0b0000011111100000,0);
    va_list va;
    va_start(va,format_string);
    //PutConsole(format_string, 0b11111,  va); // blue
    PutConsole(format_string, 0b0111101111111111,  va);
    va_end(va);
    PutConsoleNL();

    
}
void panic(char *module_name,  char *format_string)
{

    PutConsole("!! KERNEL PANIC !! ",0b1111100000000000,0);
    PutConsole(module_name,0b1111100000000000,0);
    PutConsole(" : ",0b0000011111100000,0);
    PutConsole(format_string,0b1111100000000000,0);


    while(1); // halt


    
}