Documentation
¶
Overview ¶
Package dlog is a thin wrapper over log/slog for internal flow tracing. It is distinct from the audit log (forthcoming), which records user-visible, durable events. dlog is for developers debugging the binary, off by default.
Settings come from explicit parameters; lsm reads them from the user's `~/.lsm/config.yaml` (the `log:` block) in PersistentPreRunE and passes them through. No environment variables are consulted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Discard = slog.New(slog.NewTextHandler(io.Discard, &slog.HandlerOptions{Level: slog.LevelError + 1}))
Discard is the no-op logger returned when level is "off". Useful as a zero-value fallback in callers that haven't yet been wired through PersistentPreRunE (tests, init paths).
Functions ¶
func New ¶
New constructs a logger from explicit parameters. Empty strings fall back to defaults; unknown values fall back to defaults AND emit a one-line warning to stderr describing the fallback.
level = debug | info | warn | error | off (default: off) dest = stderr | stdout | file:/absolute/path (default: stderr) format = text | json (default: text)
When level resolves to "off" the returned logger is Discard.
New does not read or mutate the process environment, so concurrent callers are safe.
Types ¶
This section is empty.