Documentation
¶
Index ¶
- func Debug(ctx context.Context, msg string, fields ...any)
- func Error(ctx context.Context, msg string, fields ...any)
- func Fatal(ctx context.Context, msg string, fields ...any)
- func Info(ctx context.Context, msg string, fields ...any)
- func Warn(ctx context.Context, msg string, fields ...any)
- func WithLogger(ctx context.Context, logger Logger) context.Context
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string, fields ...any)
Info(msg string, fields ...any)
Warn(msg string, fields ...any)
Error(msg string, fields ...any)
Fatal(msg string, fields ...any)
}
Logger represents a logger that is used by ctxlog.
func FromContext ¶
FromContext retrieves a logger from the given context. If the context does not contain a logger, a nop logger is returned.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ctxexpslog wraps slog's Logger type for use in the ctxlog package.
|
Package ctxexpslog wraps slog's Logger type for use in the ctxlog package. |
|
Package ctxslog wraps slog's Logger type for use in the ctxlog package.
|
Package ctxslog wraps slog's Logger type for use in the ctxlog package. |
|
Package ctxzap wraps zap's Logger type for use in the ctxlog package.
|
Package ctxzap wraps zap's Logger type for use in the ctxlog package. |
|
internal
|
|
Click to show internal directories.
Click to hide internal directories.