class

Logger

Module
Logging
Header
#include "Logging/Logger.h"
Namespace
Mowo

Constructors

SignatureNameDescription
Logger(const Logger&) = deleteLogger

Public functions

ReturnsNameDescription
Logger&Get
Logger&operator=
voidAddSink
voidRemoveSink
voidClearSinks
voidSetMinLevel
LogLevelGetMinLevel
voidLog
voidSetFloodGuardThe flood guard: a category that writes more than linesPerSecond lines in each of seconds consecutive seconds gets one warning naming its busiest call site.
uint32_tGetFloodGuardLinesPerSecond
voidResetFloodGuardForgets every category's window and warning, so a test starts clean.
voidLogFormat
voidFlush
voidCrashFlushWhat the crash handler runs before it copies the log tail: best effort, no allocation, and never a wait on a lock the crashing thread itself may hold.
voidCrashFlushHook
std::filesystem::pathResolveLogsDirWhere the file sink writes: <project>/Saved/Logs when a project is open, else <state root>/<Product>/Saved/Logs (Launcher, headless self-tests, packaged games with no writable project).
voidInitializeOpens the console + file sinks and rotates old Mowo_*.log files out.
voidPruneOldLogsDeletes the oldest Mowo_*.log / mowo_*.log files beyond keep.
const std::string&GetLogFilePathAbsolute path of the file sink Initialize opened; empty without one.
voidShutdown

Function details

Logger

C++
Logger(const Logger&) = delete

Get

C++
static Logger& Get()

operator=

C++
Logger& operator=(const Logger&) = delete

AddSink

C++
void AddSink(Ref<LogSink> sink)

RemoveSink

C++
void RemoveSink(const Ref<LogSink>& sink)

ClearSinks

C++
void ClearSinks()

SetMinLevel

C++
void SetMinLevel(LogLevel level)

GetMinLevel

C++
LogLevel GetMinLevel() const

Log

C++
void Log(LogLevel level, const std::string& category, const std::string& message, const char* file = nullptr, int line = 0)

SetFloodGuard

C++
void SetFloodGuard(uint32_t linesPerSecond, uint32_t seconds)

The flood guard: a category that writes more than linesPerSecond lines in each of seconds consecutive seconds gets one warning naming its busiest call site. Only call sites with a source file are counted, so a release build (which compiles none in) pays nothing. 0 turns it off.

GetFloodGuardLinesPerSecond

C++
uint32_t GetFloodGuardLinesPerSecond() const

ResetFloodGuard

C++
void ResetFloodGuard()

Forgets every category's window and warning, so a test starts clean.

LogFormat

C++
void LogFormat(LogLevel level, const std::string& category, const char* file, int line, const char* fmt, ...)

Flush

C++
void Flush()

CrashFlush

C++
void CrashFlush()

What the crash handler runs before it copies the log tail: best effort, no allocation, and never a wait on a lock the crashing thread itself may hold.

CrashFlushHook

C++
static void CrashFlushHook()

ResolveLogsDir

C++
static std::filesystem::path ResolveLogsDir()

Where the file sink writes: <project>/Saved/Logs when a project is open, else <state root>/<Product>/Saved/Logs (Launcher, headless self-tests, packaged games with no writable project).

Initialize

C++
void Initialize()

Opens the console + file sinks and rotates old Mowo_*.log files out. Release builds keep both sinks OFF and the threshold at Warning unless -log is on the command line or the game's Config sets logging.enabled=true (the bUseLoggingInShipping model).

PruneOldLogs

C++
static void PruneOldLogs(const std::filesystem::path& logsDir, size_t keep)

Deletes the oldest Mowo_*.log / mowo_*.log files beyond keep.

GetLogFilePath

C++
const std::string& GetLogFilePath() const

Absolute path of the file sink Initialize opened; empty without one.

Shutdown

C++
void Shutdown()
Generated from Logging/Logger.h via logging.json · Oct 27, 2026Version 1.0.0