Documentation ¶
Overview ¶
Author xc, Created on 2020-04-09 10:00 {COPYRIGHTS}
Author xc, Created on 2020-04-09 19:00 {COPYRIGHTS}
Index ¶
- func Debug(message interface{}, category string, ctx ...context.Context)
- func EndTiming(ctx context.Context, category string)
- func Error(message interface{}, label string, ctx ...context.Context)
- func Fatal(message interface{})
- func GetContextFields(ctx context.Context) logrus.Fields
- func Info(message interface{})
- func InitContext(ctx context.Context, info *ContextInfo) context.Context
- func LogTiming(ctx context.Context)
- func StartTiming(ctx context.Context, category string)
- func Warning(message interface{}, label string, ctx ...context.Context)
- type ContextInfo
- type RemoteHook
- type TimePoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitContext ¶
func InitContext(ctx context.Context, info *ContextInfo) context.Context
init a context log
Types ¶
type ContextInfo ¶
type ContextInfo struct { IP string RequestID string URI string UserID int Timers map[string]TimePoint Debug bool }
func GetContextInfo ¶
func GetContextInfo(ctx context.Context) *ContextInfo
type RemoteHook ¶
type RemoteHook struct { }
func (*RemoteHook) Levels ¶
func (hook *RemoteHook) Levels() []log.Level
Levels define on which log levels this hook would trigger
Click to show internal directories.
Click to hide internal directories.