scoped log gathering; communicate ctrl logs -> user via events

This commit is contained in:
Ryan Fleury
2024-04-18 14:48:03 -07:00
parent b995909997
commit 62d1c6b130
5 changed files with 74 additions and 24 deletions
+17 -5
View File
@@ -5,14 +5,21 @@
#define BASE_LOG_H
////////////////////////////////
//~ rjf: Log Type
//~ rjf: Log Types
typedef struct LogScope LogScope;
struct LogScope
{
LogScope *next;
U64 pos;
String8List strings;
};
typedef struct Log Log;
struct Log
{
Arena *arena;
U64 log_buffer_start_pos;
String8List log_buffer_strings;
LogScope *top_scope;
};
////////////////////////////////
@@ -23,10 +30,15 @@ internal void log_release(Log *log);
internal void log_select(Log *log);
////////////////////////////////
//~ rjf: Log Building/Clearing
//~ rjf: Log Building
internal void log_msg(String8 string);
internal void log_msgf(char *fmt, ...);
internal void log_clear(void);
////////////////////////////////
//~ rjf: Log Scopes
internal void log_scope_begin(void);
internal String8 log_scope_end(Arena *arena);
#endif // BASE_LOG_H