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)deprecated
- func Error(msg string, args ...any)
- func ErrorContext(ctx context.Context, msg string, args ...any)
- func Errorf(format string, args ...any)deprecated
- func Fatal(msg string, args ...any)
- func FatalContext(ctx context.Context, msg string, args ...any)
- func Fatalf(format string, args ...any)deprecated
- func Info(msg string, args ...any)
- func InfoContext(ctx context.Context, msg string, args ...any)
- func Infof(format string, args ...any)deprecated
- 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)deprecated
- func RawJSON(key, text string) slog.Attr
- func RawYAML(key, text string) slog.Attr
- func SetDefault(l *Logger)
- func SetDefaultLevel(l Level)
- func Warn(msg string, args ...any)
- func WarnContext(ctx context.Context, msg string, args ...any)
- func Warnf(format string, args ...any)deprecated
- type AddSourceVar
- type Level
- type LogOutput
- type Logger
- func (l *Logger) Debugf(format string, args ...any)deprecated
- func (l *Logger) Error(msg string, args ...any)
- func (l *Logger) Errorf(format string, args ...any)deprecated
- func (l *Logger) Fatal(msg string, args ...any)
- func (l *Logger) Fatalf(format string, args ...any)deprecated
- func (l *Logger) GetLevel() Level
- func (l *Logger) Infof(format string, args ...any)deprecated
- func (l *Logger) Logf(ctx context.Context, level Level, format string, args ...any)deprecated
- func (l *Logger) Named(name string) *Logger
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SetOutput(w io.Writer)
- func (l *Logger) Warnf(format string, args ...any)deprecated
- 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 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.