loger

package
v0.0.0-...-9f39f39 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LableKeyTraceId = "trace_id"
	LableKeySpanId  = "span_id"
	LableKeyReqId   = "req_id"
)

Variables

This section is empty.

Functions

func Error

func Error(msg string, keysAndValues ...interface{})

func Info

func Info(msg string, keysAndValues ...interface{})

func Initialize

func Initialize() error

func InitializeLoki

func InitializeLoki() error

func Warn

func Warn(msg string, keysAndValues ...interface{})

Types

type Loger

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

Loger 日志记录器 labels 用于记录日志的标签 args 用于记录日志的参数 msg (arg)k=(arg)v

func GetLoger

func GetLoger() *Loger
func WithContext(ctx context.Context) *Loger {
	return GetLoger().WithContext(ctx)
}

func WithContext

func WithContext(ctx context.Context) *Loger

func WithLabelMap

func WithLabelMap(arg map[string]interface{}) *Loger

func (*Loger) Clone

func (l *Loger) Clone() *Loger

func (*Loger) Error

func (l *Loger) Error(msg string, keysAndValues ...interface{})

func (*Loger) Info

func (l *Loger) Info(msg string, keysAndValues ...interface{})

func (*Loger) Warn

func (l *Loger) Warn(msg string, keysAndValues ...interface{})

func (*Loger) WithArg

func (l *Loger) WithArg(args ...interface{}) *Loger

func (*Loger) WithContext

func (l *Loger) WithContext(ctx context.Context) *Loger

func (*Loger) WithLabel

func (l *Loger) WithLabel(k string, v interface{}) *Loger

func (*Loger) WithLabelMap

func (l *Loger) WithLabelMap(args map[string]interface{}) *Loger

type LokiWriter

type LokiWriter struct {
	*loki.Client
}

func (*LokiWriter) Fire

func (rcv *LokiWriter) Fire(entry *logrus.Entry) error

func (*LokiWriter) Levels

func (rcv *LokiWriter) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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