Documentation
¶
Index ¶
Constants ¶
View Source
const ( LevelTrace = slog.LevelDebug - 4 // no trace level in slog, use debug-4. LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError LevelFatal = slog.LevelError + 4 // no fatal level in slog, use error+4. LevelPanic = slog.LevelError + 8 // no panic level in slog, use error+8. Disable = slog.LevelInfo + 255 // A level that disables logging, used for testing or no-op logger. )
Variables ¶
This section is empty.
Functions ¶
func NewLogHandler ¶
func NewLogHandler(logger log.ContextLogger) slog.Handler
NewLogHandler returns a new slog.Handler that writes log records to the given log.ContextLogger
Types ¶
type Factory ¶
type Factory interface {
log.ObservableFactory
SlogHandler() slog.Handler
}
func NewFactory ¶
NewFactory wraps a slog.Handler into a Factory implementation and is meant to be used with sing-box.
func NewNopFactory ¶
type SLogger ¶
type SLogger interface {
Factory
log.ContextLogger
}
SLogger is an interface that writes logs to a slog.Handler and is compatible with sing-box
Click to show internal directories.
Click to hide internal directories.