Documentation ¶
Index ¶
- Constants
- Variables
- func Critical(ctx context.Context, err error, attrs ...slog.Attr)
- func Criticalw(ctx context.Context, msg string, attrs ...slog.Attr)
- func Debug(ctx context.Context, msg string, attrs ...slog.Attr)
- func Error(ctx context.Context, err error, attrs ...slog.Attr)
- func Errorw(ctx context.Context, msg string, attrs ...slog.Attr)
- func Fatal(ctx context.Context, err error, attrs ...slog.Attr)
- func Fatalw(ctx context.Context, msg string, attrs ...slog.Attr)
- func Info(ctx context.Context, msg string, attrs ...slog.Attr)
- func SetLevel(level slog.Level)
- func Warn(ctx context.Context, msg string, attrs ...slog.Attr)
Constants ¶
View Source
const ( LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError LevelCritical = slog.Level(12) LevelFatal = slog.Level(14) )
Level is a wrapper around slog.Leveler. It adds some extra Levels, like Critical.
Variables ¶
View Source
var ( String = slog.String Int = slog.Int Float = slog.Float64 Bool = slog.Bool Any = slog.Any )
Attrs are wrappers around slog.Attr.
Functions ¶
func Fatal ¶ added in v1.4.0
Fatal logs fatal data based on an error object. It terminates the current goroutine.
DANGER: This function uses `runtime.Goexit()`. Therefore, if called within the main goroutine you MUST call `defer os.Exit(0)` at the top of the main function.
func Fatalw ¶ added in v1.4.0
Fatalw logs fatal data based on an error message. It terminates the current goroutine.
DANGER: This function uses `runtime.Goexit()`. Therefore, if called within the main goroutine you MUST call `defer os.Exit(0)` at the top of the main function.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.