mirror of
https://github.com/hanzoai/base.git
synced 2026-10-21 03:41:50 +00:00
App callers and plugins want one structured-logging surface that does
not pin them to log/slog. Add a tiny Logger interface and two
implementations:
- SlogAdapter wraps *slog.Logger so the BatchHandler-backed on-disk
storage path keeps working; exposes Slog()/Handler() for the
BatchHandler.SetLevel reload hook and tests that type-assert the
underlying handler.
- LuxfiAdapter wraps github.com/luxfi/log.Logger so packages that do
not own the storage path can run on the canonical Lux logger
directly.
Both adapters share the geth-style variadic API (msg + "k", v pairs)
that the prior commit already collapsed every call site to, so flipping
core.App.Logger() to return Logger in the next commit is a pure
type-narrowing change for ~95 percent of consumers.