Documentation ¶
Overview ¶
global logger is deprecated
Index ¶
- Constants
- func Debug(msg string, args ...any)
- func DebugContext(ctx context.Context, msg string, args ...any)
- func Debugf(format string, args ...any)
- func Error(msg string, args ...any)
- func ErrorContext(ctx context.Context, msg string, args ...any)
- func Errorf(format string, args ...any)
- func Fatal(msg string, args ...any)
- func FatalContext(ctx context.Context, msg string, args ...any)
- func Fatalf(format string, args ...any)
- func Info(msg string, args ...any)
- func InfoContext(ctx context.Context, msg string, args ...any)
- func Infof(format string, args ...any)
- func Log(ctx context.Context, level Level, msg string, args ...any)
- func LogAttrs(ctx context.Context, level Level, msg string, attrs ...slog.Attr)
- func Logf(ctx context.Context, level Level, format string, args ...any)
- func RawJSON(key, text string) slog.Attr
- func RawYAML(key, text string) slog.Attr
- func SetDefault(l *Logger)
- func SetDefaultLevel(l Level)
- func Trace(msg string, args ...any)
- func TraceContext(ctx context.Context, msg string, args ...any)
- func Tracef(format string, args ...any)
- func Warn(msg string, args ...any)
- func WarnContext(ctx context.Context, msg string, args ...any)
- func Warnf(format string, args ...any)
- type AddSourceVar
- type Level
- type LogOutput
- type Logger
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) Error(msg string, args ...any)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) Fatal(msg string, args ...any)
- func (l *Logger) Fatalf(format string, args ...any)
- func (l *Logger) GetLevel() Level
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) Logf(ctx context.Context, level Level, format string, args ...any)
- func (l *Logger) Named(name string) *Logger
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Trace(msg string, args ...any)
- func (l *Logger) Tracef(format string, args ...any)
- func (l *Logger) Warnf(format string, args ...any)
- func (l *Logger) With(args ...any) *Logger
- func (l *Logger) WithGroup(name string) *Logger
- type Options
- type Raw
- type Render
- type SlogHandler
- type WrappedLogger
Constants ¶
View Source
const KeyComponent = "component"
Variables ¶
This section is empty.
Functions ¶
func SetDefault ¶
func SetDefault(l *Logger)
func SetDefaultLevel ¶
func SetDefaultLevel(l Level)
Types ¶
type AddSourceVar ¶
type AddSourceVar struct {
// contains filtered or unexported fields
}
func (*AddSourceVar) Set ¶
func (v *AddSourceVar) Set(b bool)
func (*AddSourceVar) Source ¶
func (v *AddSourceVar) Source() *bool
func (*AddSourceVar) String ¶
func (v *AddSourceVar) String() string
type LogOutput ¶
type LogOutput struct { Level string `json:"level"` Name string `json:"logger"` Message string `json:"msg"` Source string `json:"source"` FieldsJSON []byte `json:"-"` Stacktrace string `json:"stacktrace"` Time string `json:"time"` }
func (*LogOutput) MarshalJSON ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
type Render ¶
type Render struct {
// contains filtered or unexported fields
}
func (*Render) JSONKeyValue ¶
type SlogHandler ¶
func NewHandler ¶
func NewHandler(out io.Writer, opts *slog.HandlerOptions, timeFn func(t time.Time) time.Time) *SlogHandler
func NewSlogHandler ¶
func NewSlogHandler(handler slog.Handler) *SlogHandler
type WrappedLogger ¶
Extends default slog with new log levels
func NewSlogLogger ¶
func NewSlogLogger(w io.Writer, opts *slog.HandlerOptions) *WrappedLogger
Source Files ¶
Click to show internal directories.
Click to hide internal directories.