diff options
| author | Federico Angelilli <code@fedang.net> | 2025-04-13 15:07:20 +0200 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2025-04-13 15:07:20 +0200 |
| commit | 9c9139d0eb4244c66123fdbfd211105ede8c4b42 (patch) | |
| tree | 89455d52236362c3cf953392b1cdc96aa5194fb0 /example.lua | |
| parent | 0aed18911e27b80a4dbe1a252f9485382a4073c7 (diff) | |
Add structured logging
Diffstat (limited to 'example.lua')
| -rw-r--r-- | example.lua | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/example.lua b/example.lua index cba5308..3ae2144 100644 --- a/example.lua +++ b/example.lua @@ -2,7 +2,7 @@ log.info("CRAZY") function maybe() log.warn("does it work?") - return log.panic("it does") + return log.error("it does") end log.info("%d sus", 10000) @@ -11,4 +11,32 @@ maybe() log.info("%d BIGGER %f?", 0-1, 0/0) +log.format("info", "sus %d", 10) + +local co = coroutine.create(function() + print("Coroutine running") +end) + +print(type(debug.getinfo(maybe))) + +log.value_info("hello this", { + is = "wow", + structured = "logging", + "noname", + 10, + crazy = { + what = "is", + going = "on", + }, + what = log.format, +-- file = io.open("example.txt", "w"), + extra = co, + info = debug.getinfo(maybe), +}) + + +-- errors +log.value_info("help") +log.value_info("help", 10) +log.format("lmao", "sus %d", 10) log.warn("%u %d","a") |
