10std::deque<LogEntry> g_entries;
42 std::vsnprintf(msg,
sizeof(msg), fmt, ap);
45 const char *tag = LevelTag(level);
46 const char *color = LevelColor(level);
50 std::fprintf(stream,
"%s[%s] %s:%d: %s%s\n", color, tag, fileTrim, line, msg,
kAnsiReset);
53 std::snprintf(full,
sizeof(full),
"[%s] %s:%d: %s", tag, fileTrim, line, msg);
55 g_entries.push_back({level, std::string(full)});
58 g_entries.pop_front();
constexpr const char * kAnsiError
constexpr const char * kAnsiWarn
constexpr const char * kAnsiFatal
constexpr const char * kAnsiInfo
constexpr std::size_t kMaxLogEntries
constexpr const char * kAnsiReset
constexpr std::size_t kLogMessageBufSize
constexpr std::size_t kLogFullBufSize
Console logging macros for all engine and game code.
void LogClear()
Clear the in-memory log buffer.
const std::deque< LogEntry > & LogGetEntries()
Snapshot of the in-memory log buffer (bounded ring).
const char * shortFile(const char *file)
void LogEmit(LogLevel level, const char *file, int line, const char *fmt,...)
Emit a formatted log line to stdout/stderr and the ring buffer.