logrus

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 9 Imported by: 55

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OtelSeverityText

func OtelSeverityText(lv logrus.Level) string

OtelSeverityText convert logrus level to otel severityText ref to https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#severity-fields

Types

type Option

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

func WithHook

func WithHook(hook logrus.Hook) Option

func WithLogger

func WithLogger(logger *logrus.Logger) Option

func WithRecordStackTraceInSpan

func WithRecordStackTraceInSpan(recordStackTraceInSpan bool) Option

func WithTraceHookConfig

func WithTraceHookConfig(hookConfig *TraceHookConfig) Option

func WithTraceHookErrorSpanLevel

func WithTraceHookErrorSpanLevel(level logrus.Level) Option

func WithTraceHookLevels

func WithTraceHookLevels(levels []logrus.Level) Option

type TraceHook

type TraceHook struct {
	// contains filtered or unexported fields
}

func NewTraceHook

func NewTraceHook(cfg *TraceHookConfig) *TraceHook

func (*TraceHook) Fire

func (h *TraceHook) Fire(entry *logrus.Entry) error

func (*TraceHook) Levels

func (h *TraceHook) Levels() []logrus.Level

type TraceHookConfig

type TraceHookConfig struct {
	// contains filtered or unexported fields
}

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(opts ...Option) *Writer

func (*Writer) CtxDebugf

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

func (*Writer) CtxErrorf

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

func (*Writer) CtxFatalf

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

func (*Writer) CtxInfof

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

func (*Writer) CtxNoticef

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

func (*Writer) CtxTracef

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

func (*Writer) CtxWarnf

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

func (*Writer) Debug

func (w *Writer) Debug(v ...interface{})

func (*Writer) Debugf

func (w *Writer) Debugf(format string, v ...interface{})

func (*Writer) Error

func (w *Writer) Error(v ...interface{})

func (*Writer) Errorf

func (w *Writer) Errorf(format string, v ...interface{})

func (*Writer) Fatal

func (w *Writer) Fatal(v ...interface{})

func (*Writer) Fatalf

func (w *Writer) Fatalf(format string, v ...interface{})

func (*Writer) Info

func (w *Writer) Info(v ...interface{})

func (*Writer) Infof

func (w *Writer) Infof(format string, v ...interface{})

func (*Writer) Logger

func (w *Writer) Logger() *logrus.Logger

func (*Writer) Notice

func (w *Writer) Notice(v ...interface{})

func (*Writer) Noticef

func (w *Writer) Noticef(format string, v ...interface{})

func (*Writer) Printf

func (w *Writer) Printf(format string, v ...interface{})

func (*Writer) SetOutput

func (w *Writer) SetOutput(writer io.Writer)

func (*Writer) Trace

func (w *Writer) Trace(v ...interface{})

func (*Writer) Tracef

func (w *Writer) Tracef(format string, v ...interface{})

func (*Writer) Warn

func (w *Writer) Warn(v ...interface{})

func (*Writer) Warnf

func (w *Writer) Warnf(format string, v ...interface{})

Jump to

Keyboard shortcuts

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