Improve default temp_allocator; make nil loggers do nothing; improve mem.Scratch_Allocator behaviour

This commit is contained in:
gingerBill
2020-10-02 16:06:55 +01:00
parent a65553293f
commit 6eeb12a986
4 changed files with 195 additions and 130 deletions
+6
View File
@@ -123,6 +123,9 @@ panicf :: proc(fmt_str: string, args: ..any, location := #caller_location) -> !
log :: proc(level: Level, args: ..any, sep := " ", location := #caller_location) {
logger := context.logger;
if logger.procedure == nil {
return;
}
if level < logger.lowest_level {
return;
}
@@ -132,6 +135,9 @@ log :: proc(level: Level, args: ..any, sep := " ", location := #caller_location)
logf :: proc(level: Level, fmt_str: string, args: ..any, location := #caller_location) {
logger := context.logger;
if logger.procedure == nil {
return;
}
if level < logger.lowest_level {
return;
}