aboutsummaryrefslogtreecommitdiff
path: root/test/log.cc
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-10-16 20:11:55 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-10-16 20:11:55 +0200
commitd80134afe11289bf68630d59e0db5edcbb898c20 (patch)
tree16d20a673e56449a3502d15d669d76a1a761b255 /test/log.cc
parenta28790b91d89002edb27dd1bc3997b1d03a94d7e (diff)
downloadcpp-utils-d80134afe11289bf68630d59e0db5edcbb898c20.tar.gz
cpp-utils-d80134afe11289bf68630d59e0db5edcbb898c20.zip
log: add minimal stderr logger
Diffstat (limited to 'test/log.cc')
-rw-r--r--test/log.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/log.cc b/test/log.cc
new file mode 100644
index 0000000..c059ba8
--- /dev/null
+++ b/test/log.cc
@@ -0,0 +1,19 @@
+#include <log.h>
+
+int main() {
+ logging::logger<> mlog;
+ mlog.set_level(logging::kDbg0);
+
+ INFO(&mlog, "Hallo %d", 42);
+ WARN(&mlog, "Hallo %x", 0x1337);
+ FAIL(&mlog, "Hallo %u", 666);
+ DBG0(&mlog, "Hallo %p", (void*)0xf00df00d);
+
+ {
+ logging::logger<false> mlog;
+ INFO(&mlog, "Hallo no time, %d", 42);
+ WARN(&mlog, "Hallo no time, %x", 0x1337);
+ FAIL(&mlog, "Hallo no time, %u", 666);
+ DBG0(&mlog, "Hallo no time, %p", (void*)0xf00df00d);
+ }
+}