mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-01 04:10:05 +00:00
finished with base?
This commit is contained in:
@@ -22,6 +22,35 @@ log_select(Log* log) {
|
||||
log_active = log;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Building
|
||||
|
||||
void
|
||||
log_msg(LogMsgKind kind, String8 string) {
|
||||
if(log_active != 0 && log_active->top_scope != 0) {
|
||||
String8 string_copy = push_str8_copy(log_active->arena, string);
|
||||
str8_list_push(log_active->arena, &log_active->top_scope->strings[kind], string_copy);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
log_msgf(LogMsgKind kind, char *fmt, ...) {
|
||||
if(log_active != 0)
|
||||
{
|
||||
// TODO(Ed): Review
|
||||
TempArena scratch = scratch_begin(0, 0);
|
||||
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8 string = push_str8fv(scratch.arena, fmt, args);
|
||||
log_msg(kind, string);
|
||||
va_end(args);
|
||||
|
||||
scratch_end(scratch);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Log Scopes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user