Documentation
¶
Index ¶
- Constants
- func Debug(msg string, args ...any)
- func DebugContext(ctx context.Context, msg string, args ...any)
- func Error(msg string, args ...any)
- func ErrorContext(ctx context.Context, msg string, args ...any)
- func ExtraDebug(msg string, args ...any)
- func ExtraDebugContext(ctx context.Context, msg string, args ...any)
- func Info(msg string, args ...any)
- func InfoContext(ctx context.Context, msg string, args ...any)
- func NewJSONHandler(w io.Writer, opts *slog.HandlerOptions) *slog.JSONHandler
- func NewTextHandler(w io.Writer, opts *slog.HandlerOptions) *slog.TextHandler
- func SetDefault(l *Logger)
- func Trace(msg string, args ...any)
- func TraceContext(ctx context.Context, msg string, args ...any)
- func Warn(msg string, args ...any)
- func WarnContext(ctx context.Context, msg string, args ...any)
- type Level
- type Logger
- func (l *Logger) ExtraDebug(msg string, args ...any)
- func (l *Logger) ExtraDebugContext(ctx context.Context, msg string, args ...any)
- func (l *Logger) Trace(msg string, args ...any)
- func (l *Logger) TraceContext(ctx context.Context, msg string, args ...any)
- func (l *Logger) With(args ...any) *Logger
Constants ¶
View Source
const ( // standard levels LevelDebug = slog.LevelDebug LevelInfo = slog.LevelInfo LevelWarn = slog.LevelWarn LevelError = slog.LevelError // LevelExtraDebug is between Debug and Trace. It had extra information that's useful sometimes // but not as overwhelming as Trace. e.g. OTEL logging is at this level. LevelExtraDebug = slog.LevelDebug - 1 // Trace is the most verbose level. It includes session logging and an enormous amount of detail from // buildkit on cache refs and cache queries. LevelTrace = slog.LevelDebug - 2 )
Variables ¶
This section is empty.
Functions ¶
func ExtraDebug ¶
func NewJSONHandler ¶
func NewJSONHandler(w io.Writer, opts *slog.HandlerOptions) *slog.JSONHandler
func NewTextHandler ¶
func NewTextHandler(w io.Writer, opts *slog.HandlerOptions) *slog.TextHandler
func SetDefault ¶
func SetDefault(l *Logger)
Types ¶
type Logger ¶
Logger wraps the slog.Logger type with support for a few additional levels
func (*Logger) ExtraDebug ¶
func (*Logger) ExtraDebugContext ¶
func (*Logger) TraceContext ¶
Click to show internal directories.
Click to hide internal directories.