zap

package module
v0.0.0-...-c1931b4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OtelSeverityText

func OtelSeverityText(lv zapcore.Level) string

OtelSeverityText convert zapcore 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 {
	hertzzap.Logger
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(opts ...Option) *Logger

func (*Logger) CtxDebugf

func (l *Logger) CtxDebugf(ctx context.Context, format string, v ...interface{})

func (*Logger) CtxErrorf

func (l *Logger) CtxErrorf(ctx context.Context, format string, v ...interface{})

func (*Logger) CtxFatalf

func (l *Logger) CtxFatalf(ctx context.Context, format string, v ...interface{})

func (*Logger) CtxInfof

func (l *Logger) CtxInfof(ctx context.Context, format string, v ...interface{})

func (*Logger) CtxLogf

func (l *Logger) CtxLogf(level hlog.Level, ctx context.Context, format string, kvs ...interface{})

func (*Logger) CtxNoticef

func (l *Logger) CtxNoticef(ctx context.Context, format string, v ...interface{})

func (*Logger) CtxTracef

func (l *Logger) CtxTracef(ctx context.Context, format string, v ...interface{})

func (*Logger) CtxWarnf

func (l *Logger) CtxWarnf(ctx context.Context, format string, v ...interface{})

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithLogger

func WithLogger(logger *hertzzap.Logger) Option

WithLogger configures logger

func WithRecordStackTraceInSpan

func WithRecordStackTraceInSpan(recordStackTraceInSpan bool) Option

WithRecordStackTraceInSpan record stack track option

func WithTraceErrorSpanLevel

func WithTraceErrorSpanLevel(level zapcore.Level) Option

WithTraceErrorSpanLevel trace error span level option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL