Documentation ¶
Overview ¶
Package logger provides support for initializing the log system.
Index ¶
- Constants
- func NewStdLogger(logger *Logger, level Level) *log.Logger
- type EventFn
- type Events
- type Level
- type Logger
- func (log *Logger) Debug(ctx context.Context, msg string, args ...any)
- func (log *Logger) Debugc(ctx context.Context, caller int, msg string, args ...any)
- func (log *Logger) Error(ctx context.Context, msg string, args ...any)
- func (log *Logger) Errorc(ctx context.Context, caller int, msg string, args ...any)
- func (log *Logger) Info(ctx context.Context, msg string, args ...any)
- func (log *Logger) Infoc(ctx context.Context, caller int, msg string, args ...any)
- func (log *Logger) Warn(ctx context.Context, msg string, args ...any)
- func (log *Logger) Warnc(ctx context.Context, caller int, msg string, args ...any)
- type Record
- type TraceIDFn
Constants ¶
View Source
const ( LevelDebug = Level(slog.LevelDebug) LevelInfo = Level(slog.LevelInfo) LevelWarn = Level(slog.LevelWarn) LevelError = Level(slog.LevelError) )
A set of possible logging levels.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger represents a logger for logging information.
func NewWithEvents ¶
func NewWithEvents(w io.Writer, minLevel Level, serviceName string, traceIDFn TraceIDFn, events Events) *Logger
NewWithEvents constructs a new log for application use with events.
func NewWithHandler ¶
NewWithHandler returns a new log for application use with the underlying handler.
Click to show internal directories.
Click to hide internal directories.