Documentation ¶
Index ¶
- Constants
- Variables
- func AddHook(hook Hook)
- func FromStackContext(ctx context.Context) error
- func FromTagContext(ctx context.Context) string
- func FromTraceIDContext(ctx context.Context) string
- func FromUserIDContext(ctx context.Context) string
- func NewStackContext(ctx context.Context, stack error) context.Context
- func NewTagContext(ctx context.Context, tag string) context.Context
- func NewTraceIDContext(ctx context.Context, traceID string) context.Context
- func NewUserIDContext(ctx context.Context, userID string) context.Context
- func SetFormatter(format string)
- func SetLevel(level int)
- func SetOutput(out io.Writer)
- func SetVersion(v string)
- type Entry
- type Hook
- type Logger
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 FromStackContext ¶
func FromTagContext ¶
func FromTraceIDContext ¶
func FromUserIDContext ¶
func NewTraceIDContext ¶
func SetFormatter ¶
func SetFormatter(format string)
func SetVersion ¶
func SetVersion(v string)
Types ¶
type Entry ¶
func WithContext ¶
Click to show internal directories.
Click to hide internal directories.