aboutsummaryrefslogtreecommitdiff
path: root/src/example/log.cpp
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-03 11:23:54 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-11-03 11:23:54 +0100
commit75cf0b8e72aff7072c25ab015ce5c9c64eb3ecc5 (patch)
treedd459130f169a924db0637146d31ed20aaa10d74 /src/example/log.cpp
parented8534e2d150428bcbc4a6df8940323ae8db2925 (diff)
parent6aa8fdd04728b6a499f526de727514ae3d0490b4 (diff)
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/events-poc
Diffstat (limited to 'src/example/log.cpp')
-rw-r--r--src/example/log.cpp17
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;
}