aboutsummaryrefslogtreecommitdiff
path: root/example.lua
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2025-04-13 15:07:20 +0200
committerFederico Angelilli <code@fedang.net>2025-04-13 15:07:20 +0200
commit9c9139d0eb4244c66123fdbfd211105ede8c4b42 (patch)
tree89455d52236362c3cf953392b1cdc96aa5194fb0 /example.lua
parent0aed18911e27b80a4dbe1a252f9485382a4073c7 (diff)
Add structured logging
Diffstat (limited to 'example.lua')
-rw-r--r--example.lua30
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")