aboutsummaryrefslogtreecommitdiff
path: root/src/example
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 14:35:27 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-13 14:35:27 +0100
commit1df510f4a2dbe0fcb8c9f8a34695abf8d33f9ddc (patch)
tree2a901a09957abe1363f5b21ee259036f23f66087 /src/example
parentdaf2a06ac778f203e1473431afe09476e8182f65 (diff)
update logging to use C++20 format and classes
Diffstat (limited to 'src/example')
-rw-r--r--src/example/log.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/example/log.cpp b/src/example/log.cpp
index db8aa48..13d592b 100644
--- a/src/example/log.cpp
+++ b/src/example/log.cpp
@@ -4,7 +4,7 @@
*/
#include <crepe/api/Config.h>
-#include <crepe/util/log.h>
+#include <crepe/util/Log.h>
using namespace crepe;
@@ -12,17 +12,18 @@ using namespace crepe;
int _ = []() {
// make sure all log messages get printed
auto & cfg = Config::get_instance();
- cfg.log.level = LogLevel::TRACE;
+ cfg.log.level = Log::Level::TRACE;
return 0; // satisfy compiler
}();
int main() {
dbg_trace();
- dbg_logf("test printf parameters: %d", 3);
- logf(LogLevel::INFO, "info message");
- logf(LogLevel::WARNING, "warning");
- logf(LogLevel::ERROR, "error");
+ dbg_log("debug message");
+ Log::logf("info message with variable: {}", 3);
+ Log::logf(Log::Level::WARNING, "warning");
+ Log::logf(Log::Level::ERROR, "error");
+
return 0;
}