logs

package
v0.0.0-...-2bb2ce4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTraceID

func GetTraceID(ctx context.Context) int64

func PutTraceID

func PutTraceID(ctx context.Context, traceID int64) context.Context

Types

type ContextKey

type ContextKey string
const (
	ContextKeyTraceID ContextKey = "logContextKeyTraceID"
)

type Fields

type Fields interface {
	Add(key string, value interface{})
}

type Loggable

type Loggable interface {
	Log(fields Fields)
}

type Logger

type Logger interface {
	ForClass(pkg string, class string) Logger
	SetOutput(io.Writer)
	Debug(ctx context.Context, msg string, loggable ...Loggable)
	Info(ctx context.Context, msg string, loggable ...Loggable)
	Warn(ctx context.Context, msg string, loggable ...Loggable)
	Error(ctx context.Context, msg string, loggable ...Loggable)
	Fatal(ctx context.Context, msg string, loggable ...Loggable)
}

func NewLogrus

func NewLogrus(properties LogrusLoggerProperties) Logger

type LogrusEntry

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

func (LogrusEntry) Debug

func (e LogrusEntry) Debug(ctx context.Context, msg string, loggables ...Loggable)

func (LogrusEntry) Error

func (e LogrusEntry) Error(ctx context.Context, msg string, loggables ...Loggable)

func (LogrusEntry) Fatal

func (e LogrusEntry) Fatal(ctx context.Context, msg string, loggables ...Loggable)

func (LogrusEntry) ForClass

func (e LogrusEntry) ForClass(pkg string, class string) Logger

func (LogrusEntry) Info

func (e LogrusEntry) Info(ctx context.Context, msg string, loggables ...Loggable)

func (LogrusEntry) SetOutput

func (e LogrusEntry) SetOutput(w io.Writer)

func (LogrusEntry) Warn

func (e LogrusEntry) Warn(ctx context.Context, msg string, loggables ...Loggable)

type LogrusFields

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

func (*LogrusFields) Add

func (f *LogrusFields) Add(key string, value interface{})

type LogrusLogger

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

func (LogrusLogger) Debug

func (l LogrusLogger) Debug(ctx context.Context, msg string, loggables ...Loggable)

func (LogrusLogger) Error

func (l LogrusLogger) Error(ctx context.Context, msg string, loggables ...Loggable)

func (LogrusLogger) Fatal

func (l LogrusLogger) Fatal(ctx context.Context, msg string, loggables ...Loggable)

func (LogrusLogger) ForClass

func (l LogrusLogger) ForClass(pkg string, class string) Logger

func (LogrusLogger) Info

func (l LogrusLogger) Info(ctx context.Context, msg string, loggables ...Loggable)

func (LogrusLogger) SetOutput

func (l LogrusLogger) SetOutput(w io.Writer)

func (LogrusLogger) Warn

func (l LogrusLogger) Warn(ctx context.Context, msg string, loggables ...Loggable)

type LogrusLoggerProperties

type LogrusLoggerProperties struct {
	Formatter logrus.Formatter
	Level     logrus.Level
	Output    io.Writer
}

type MapFields

type MapFields map[string]interface{}

func (MapFields) Log

func (m MapFields) Log(fields Fields)

Jump to

Keyboard shortcuts

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