Documentation ¶
Index ¶
- func OtelSeverityText(lv zerolog.Level) string
- type ExtraKey
- type Logger
- func (l *Logger) CtxDebugf(ctx context.Context, format string, v ...any)
- func (l *Logger) CtxErrorf(ctx context.Context, format string, v ...any)
- func (l *Logger) CtxFatalf(ctx context.Context, format string, v ...any)
- func (l *Logger) CtxInfof(ctx context.Context, format string, v ...any)
- func (l *Logger) CtxLogf(level klog.Level, ctx context.Context, format string, kvs ...any)
- func (l *Logger) CtxNoticef(ctx context.Context, format string, v ...any)
- func (l *Logger) CtxTracef(ctx context.Context, format string, v ...any)
- func (l *Logger) CtxWarnf(ctx context.Context, format string, v ...any)
- func (l *Logger) Debug(v ...any)
- func (l *Logger) Debugf(format string, v ...any)
- func (l *Logger) Error(v ...any)
- func (l *Logger) Errorf(format string, v ...any)
- func (l *Logger) Fatal(v ...any)
- func (l *Logger) Fatalf(format string, v ...any)
- func (l *Logger) Info(v ...any)
- func (l *Logger) Infof(format string, v ...any)
- func (l *Logger) Log(level klog.Level, kvs ...any)
- func (l *Logger) Logf(level klog.Level, format string, kvs ...any)
- func (l *Logger) Logger() *zerolog.Logger
- func (l *Logger) Notice(v ...any)
- func (l *Logger) Noticef(format string, v ...any)
- func (l *Logger) SetLevel(level klog.Level)
- func (l *Logger) SetOutput(writer io.Writer)
- func (l *Logger) Trace(v ...any)
- func (l *Logger) Tracef(format string, v ...any)
- func (l *Logger) Warn(v ...any)
- func (l *Logger) Warnf(format string, v ...any)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OtelSeverityText ¶
OtelSeverityText convert zerolog level to otel severityText ref to https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#severity-fields
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) CtxDebugf ¶
CtxDebugf logs a message at debug level with logger associated with context. If no logger is associated, DefaultContextLogger is used, unless DefaultContextLogger is nil, in which case a disabled logger is used.
func (*Logger) CtxErrorf ¶
CtxErrorf logs a message at error level with logger associated with context. If no logger is associated, DefaultContextLogger is used, unless DefaultContextLogger is nil, in which case a disabled logger is used.
func (*Logger) CtxFatalf ¶
CtxFatalf logs a message at fatal level with logger associated with context. If no logger is associated, DefaultContextLogger is used, unless DefaultContextLogger is nil, in which case a disabled logger is used.
func (*Logger) CtxInfof ¶
CtxInfof logs a message at info level with logger associated with context. If no logger is associated, DefaultContextLogger is used, unless DefaultContextLogger is nil, in which case a disabled logger is used.
func (*Logger) CtxLogf ¶
CtxLogf log with logger associated with context. If no logger is associated, DefaultContextLogger is used, unless DefaultContextLogger is nil, in which case a disabled logger is used.
func (*Logger) CtxNoticef ¶
CtxNoticef logs a message at notice level with logger associated with context. If no logger is associated, DefaultContextLogger is used, unless DefaultContextLogger is nil, in which case a disabled logger is used.
func (*Logger) CtxTracef ¶
CtxTracef logs a message at trace level with logger associated with context. If no logger is associated, DefaultContextLogger is used, unless DefaultContextLogger is nil, in which case a disabled logger is used.
func (*Logger) CtxWarnf ¶
CtxWarnf logs a message at warn level with logger associated with context. If no logger is associated, DefaultContextLogger is used, unless DefaultContextLogger is nil, in which case a disabled logger is used.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithRecordStackTraceInSpan ¶
WithRecordStackTraceInSpan record stack track option
func WithTraceErrorSpanLevel ¶
WithTraceErrorSpanLevel trace error span level option