logger

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

View Source
const (
	TraceIDKey = "trace_id"
	UserIDKey  = "user_id"
	TagKey     = "tag"
	VersionKey = "version"
	StackKey   = "stack"
)

Define key

Variables

View Source
var (
	Tracef = logrus.Tracef
	Debugf = logrus.Debugf
	Infof  = logrus.Infof
	Warnf  = logrus.Warnf
	Errorf = logrus.Errorf
	Fatalf = logrus.Fatalf
	Panicf = logrus.Panicf
	Printf = logrus.Printf
)

Define logrus alias

Functions

func AddHook

func AddHook(hook Hook)

func FromStackContext

func FromStackContext(ctx context.Context) error

func FromTagContext

func FromTagContext(ctx context.Context) string

func FromTraceIDContext

func FromTraceIDContext(ctx context.Context) string

func FromUserIDContext

func FromUserIDContext(ctx context.Context) string

func NewStackContext

func NewStackContext(ctx context.Context, stack error) context.Context

func NewTagContext

func NewTagContext(ctx context.Context, tag string) context.Context

func NewTraceIDContext

func NewTraceIDContext(ctx context.Context, traceID string) context.Context

func NewUserIDContext

func NewUserIDContext(ctx context.Context, userID string) context.Context

func SetFormatter

func SetFormatter(format string)

func SetLevel

func SetLevel(level int)

func SetOutput

func SetOutput(out io.Writer)

func SetVersion

func SetVersion(v string)

Types

type Entry

type Entry = logrus.Entry

func Named added in v0.0.2

func Named(name string) *Entry

func WithContext

func WithContext(ctx context.Context) *Entry

func WithErrorStack

func WithErrorStack(ctx context.Context, err error) *Entry

type Hook

type Hook = logrus.Hook

type Logger

type Logger = logrus.Logger

func StandardLogger

func StandardLogger() *Logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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