Documentation ¶
Index ¶
- func Debug(ctx context.Context, args ...any)
- func Debugf(ctx context.Context, template string, args ...any)
- func Error(ctx context.Context, args ...any)
- func Errorf(ctx context.Context, template string, args ...any)
- func Fatal(ctx context.Context, args ...any)
- func Fatalf(ctx context.Context, template string, args ...any)
- func Info(ctx context.Context, args ...any)
- func Infof(ctx context.Context, template string, args ...any)
- func Panic(ctx context.Context, args ...any)
- func Panicf(ctx context.Context, template string, args ...any)
- func RegisterLogger(newLogger Logger)
- func Sync() error
- func Warn(ctx context.Context, args ...any)
- func Warnf(ctx context.Context, template string, args ...any)
- type ContextWriter
- type Level
- type Logger
- func (l Logger) Debug(ctx context.Context, args ...any)
- func (l Logger) Debugf(ctx context.Context, template string, args ...any)
- func (l Logger) Error(ctx context.Context, args ...any)
- func (l Logger) Errorf(ctx context.Context, template string, args ...any)
- func (l Logger) Fatal(ctx context.Context, args ...any)
- func (l Logger) Fatalf(ctx context.Context, template string, args ...any)
- func (l Logger) Info(ctx context.Context, args ...any)
- func (l Logger) Infof(ctx context.Context, template string, args ...any)
- func (l Logger) NoContext() Writer[noContextLogger]
- func (l Logger) Panic(ctx context.Context, args ...any)
- func (l Logger) Panicf(ctx context.Context, template string, args ...any)
- func (l Logger) Sync() error
- func (l Logger) Warn(ctx context.Context, args ...any)
- func (l Logger) Warnf(ctx context.Context, template string, args ...any)
- func (l Logger) With(key string, value any) Logger
- type Params
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterLogger ¶
func RegisterLogger(newLogger Logger)
RegisterLogger by constructing Logger via NewLogger, global Logger is disabled by default
Types ¶
type ContextWriter ¶
type ContextWriter[T any] interface { With(key string, value any) T Debug(ctx context.Context, args ...any) Debugf(ctx context.Context, template string, args ...any) Info(ctx context.Context, args ...any) Infof(ctx context.Context, template string, args ...any) Warn(ctx context.Context, args ...any) Warnf(ctx context.Context, template string, args ...any) Error(ctx context.Context, args ...any) Errorf(ctx context.Context, template string, args ...any) Panic(ctx context.Context, args ...any) Panicf(ctx context.Context, template string, args ...any) Fatal(ctx context.Context, args ...any) Fatalf(ctx context.Context, template string, args ...any) }
type Level ¶
type Level string
func (Level) ToZapAtomic ¶
func (lvl Level) ToZapAtomic() zap.AtomicLevel
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewNoopLogger ¶
func NewNoopLogger() Logger
type Writer ¶
type Writer[T any] interface { With(key string, value any) T Debug(args ...any) Debugf(template string, args ...any) Info(args ...any) Infof(template string, args ...any) Warn(args ...any) Warnf(template string, args ...any) Error(args ...any) Errorf(template string, args ...any) Panic(args ...any) Panicf(template string, args ...any) Fatal(args ...any) Fatalf(template string, args ...any) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.