diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-01 14:40:48 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-01 14:40:48 +0100 |
commit | 83ce876b4c1b12c3654413515840f5f71907ea6c (patch) | |
tree | 822568486d429dfd1231a971f412d1ba534b783f /src/example/log.cpp | |
parent | b2fc208fbdb55ecc3cba59e2dd51976ce829a4be (diff) | |
parent | 6aa8fdd04728b6a499f526de727514ae3d0490b4 (diff) |
Merge branch 'master' into loek/savemgr
Diffstat (limited to 'src/example/log.cpp')
-rw-r--r-- | src/example/log.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/example/log.cpp b/src/example/log.cpp index 3bc6d80..04ab9cd 100644 --- a/src/example/log.cpp +++ b/src/example/log.cpp @@ -9,16 +9,21 @@ using namespace crepe; using namespace crepe::util; -int main() { - auto & cfg = api::Config::get_instance(); +// unrelated setup code +int _ = [] () { // make sure all log messages get printed + auto & cfg = api::Config::get_instance(); cfg.log.level = util::LogLevel::TRACE; + return 0; // satisfy compiler +} (); + +int main() { dbg_trace(); - dbg_logf("cfg.log.color is equal to %d", cfg.log.color); - logf(LogLevel::INFO, "info message!"); - logf(LogLevel::WARNING, "very scary warning"); - logf(LogLevel::ERROR, "fatal error!!!"); + dbg_logf("test printf parameters: %d", 3); + logf(LogLevel::INFO, "info message"); + logf(LogLevel::WARNING, "warning"); + logf(LogLevel::ERROR, "error"); return 0; } |