Documentation
¶
Overview ¶
Package logutil provides helpers for logging
Index ¶
Constants ¶
const ( LevelTrace slog.Level = -8 LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError LevelSilent slog.Level = 12 )
Add a lower Silent level and higher Trace level to the standard slog levels.
Variables ¶
This section is empty.
Functions ¶
func AsLevel ¶
AsLevel parses the given level value and returns the corresponding slog.Level. It supports slog.Level, int, and string types. If the input is not recognized, it defaults to LevelSilent.
func UpdateLevel ¶
UpdateLevel updates the logging level based on the provided string. It is used as a callback in pflags BoolFuncP which is why it returns an error even though the returned value is always nil.
Types ¶
This section is empty.