Documentation
¶
Index ¶
- Constants
- type CLog
- type CustomLogger
- func (l *CustomLogger) AddKeysValuesToCtx(ctx context.Context, kv map[string]interface{}) context.Context
- func (l *CustomLogger) DebugCtx(ctx context.Context, msg string, args ...any)
- func (l *CustomLogger) ErrorCtx(ctx context.Context, err error, msg string, args ...any)
- func (l *CustomLogger) InfoCtx(ctx context.Context, msg string, args ...any)
- func (l *CustomLogger) WarnCtx(ctx context.Context, msg string, args ...any)
- type Level
- type Stub
- func (l *Stub) AddKeysValuesToCtx(ctx context.Context, _ map[string]interface{}) context.Context
- func (l *Stub) DebugCtx(_ context.Context, _ string, _ ...any)
- func (l *Stub) ErrorCtx(_ context.Context, _ error, _ string, _ ...any)
- func (l *Stub) InfoCtx(_ context.Context, _ string, _ ...any)
- func (l *Stub) WarnCtx(_ context.Context, _ string, _ ...any)
Constants ¶
View Source
const ( LevelDebug = Level(slog.LevelDebug) LevelInfo = Level(slog.LevelInfo) LevelWarn = Level(slog.LevelWarn) LevelError = Level(slog.LevelError) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLog ¶ added in v0.0.25
type CLog interface { AddKeysValuesToCtx(ctx context.Context, kv map[string]interface{}) context.Context ErrorCtx(ctx context.Context, err error, msg string, args ...any) InfoCtx(ctx context.Context, msg string, args ...any) DebugCtx(ctx context.Context, msg string, args ...any) WarnCtx(ctx context.Context, msg string, args ...any) }
type CustomLogger ¶
func NewCustomLogger ¶
func NewCustomLogger(dest io.Writer, level Level, addSource bool) *CustomLogger
func (*CustomLogger) AddKeysValuesToCtx ¶
func (*CustomLogger) DebugCtx ¶ added in v0.0.20
func (l *CustomLogger) DebugCtx(ctx context.Context, msg string, args ...any)
DebugCtx logs a debug message with fmt.SprintF()
Click to show internal directories.
Click to hide internal directories.