Documentation
¶
Overview ¶
Package lua exposes hex/log to Lua scripts as the "log" module.
local log = require("log")
log.info("hello", { user = "alice" })
log.debug("query", { sql = "SELECT ..." })
log.warn("slow", { ms = 823 })
log.error("boom", { err = tostring(err) })
The optional second argument is a table of key/value attributes, forwarded to slog / hex/log as structured fields. Keys should be strings; values are converted with the same rules used by hex/db/lua and hex/config/lua (numbers, strings, bools, nil, nested tables become their string form).
The module delegates to hex/log's package-level functions, which in turn use slog.Default. This lets tests swap the global handler via slog.SetDefault and see Lua-side log calls captured.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeStub string
TypeStub is the Teal .d.tl source describing the `log` module.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.