Documentation
¶
Index ¶
Constants ¶
View Source
const ( TraceIDKey = "TID" // 日志traceId key, value 为 string UserIDKey = "UID" // 日志用户ID key, value 为 uint64 )
View Source
const ( LevelOff uint32 = 0 //关闭 LevelFatal uint32 = 1 //致命 LevelError uint32 = 2 //错误 LevelWarn uint32 = 3 //警告 LevelInfo uint32 = 4 //信息 LevelDebug uint32 = 5 //调试 LevelTrace uint32 = 6 //跟踪 LevelOn uint32 = 7 //全部打开 )
日志等级
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ILog ¶
type ILog interface {
GetLevel() uint32
SetLevel(level uint32) error
Stop() error
Trace(v ...any)
TraceExtend(ctx context.Context, extendFields ExtendFields, v ...any)
Tracef(format string, v ...any)
TracefExtend(ctx context.Context, extendFields ExtendFields, format string, v ...any)
Debug(v ...any)
DebugExtend(ctx context.Context, extendFields ExtendFields, v ...any)
DebugLazy(vFunc func() []any)
Debugf(format string, v ...any)
DebugfExtend(ctx context.Context, extendFields ExtendFields, format string, v ...any)
DebugfLazy(formatFunc func() (string, []any))
Info(v ...any)
InfoExtend(ctx context.Context, extendFields ExtendFields, v ...any)
Infof(format string, v ...any)
InfofExtend(ctx context.Context, extendFields ExtendFields, format string, v ...any)
Warn(v ...any)
WarnExtend(ctx context.Context, extendFields ExtendFields, v ...any)
Warnf(format string, v ...any)
WarnfExtend(ctx context.Context, extendFields ExtendFields, format string, v ...any)
Error(v ...any)
ErrorExtend(ctx context.Context, extendFields ExtendFields, v ...any)
Errorf(format string, v ...any)
ErrorfExtend(ctx context.Context, extendFields ExtendFields, format string, v ...any)
Fatal(v ...any)
FatalExtend(ctx context.Context, extendFields ExtendFields, v ...any)
Fatalf(format string, v ...any)
FatalfExtend(ctx context.Context, extendFields ExtendFields, format string, v ...any)
}
var GLog ILog
Click to show internal directories.
Click to hide internal directories.