Enhance logger interface with 'f' and not 'f' variants, also move level detection out

This commit is contained in:
Mikkel Hjortshoej
2020-02-10 01:26:04 +01:00
parent 0c09cb9c12
commit 9d5692ae68
3 changed files with 32 additions and 21 deletions
+5 -4
View File
@@ -276,9 +276,10 @@ Logger_Options :: bit_set[Logger_Option];
Logger_Proc :: #type proc(data: rawptr, level: Logger_Level, text: string, options: Logger_Options, location := #caller_location);
Logger :: struct {
procedure: Logger_Proc,
data: rawptr,
options: Logger_Options,
procedure: Logger_Proc,
data: rawptr,
lowest_level: Logger_Level,
options: Logger_Options,
}
Context :: struct {
@@ -434,7 +435,7 @@ default_logger_proc :: proc(data: rawptr, level: Logger_Level, text: string, opt
}
default_logger :: proc() -> Logger {
return Logger{default_logger_proc, nil, nil};
return Logger{default_logger_proc, nil, Logger_Level.Debug, nil};
}