Versions in this module Expand all Collapse all v2 v2.0.1 Apr 22, 2026 v2.0.0 Apr 22, 2026 Changes in this version + const DEBUG + const DPANIC + const ERROR + const FATAL + const INFO + const NameKeyLevel + const NameKeyMod + const NameKeyMsg + const NameKeyPos + const NameKeyTime + const OPT_COLOR + const OPT_DEFAULT + const OPT_ENC_CONSOLE + const OPT_ROTATE + const OPT_SHORT_CALLER + const OPT_STDOUT + const PANIC + const STDOUT + const WARN + var MaxAge = 30 + var MaxBackups = 5 + var MaxSize = 32 + var SchemeTCP = "tcp" + var SchemeUDP = "udp" + var StdoutColor bool + var StdoutLevel = DEBUG + func Close() + func InitCustomizeRoot(opt *Option) (*zap.Logger, error) + func InitRoot(opt *Option) error + func NewLoggerCtx(opts ...CtxOption) *loggerCtx + func Reset() + func SetGlobalRootLogger(fpath, level string, options int) error + func TotalSLoggers() int64 + type CtxOption interface + func EnableTrace() CtxOption + func WithParseTrace(f ExtractTrace) CtxOption + func WithTraceKey(tn string, sn string) CtxOption + func WithZapCore(core zapcore.Core) CtxOption + func WithZapOpts(opts ...zap.Option) CtxOption + type ExtractTrace func(ctx context.Context) Trace + type Logger struct + func DefaultSLogger(name string) *Logger + func DefaultSloggerSkipN(name string, callerSkip int) *Logger + func SLogger(name string, opts ...SLogerOpt) *Logger + func (l *Logger) Debug(args ...any) + func (l *Logger) Debugf(fmt string, args ...any) + func (l *Logger) Debugw(fmt string, args ...any) + func (l *Logger) Error(args ...any) + func (l *Logger) Errorf(fmt string, args ...any) + func (l *Logger) Errorw(fmt string, args ...any) + func (l *Logger) Fatal(args ...any) + func (l *Logger) Fatalf(fmt string, args ...any) + func (l *Logger) Fatalw(fmt string, args ...any) + func (l *Logger) Info(args ...any) + func (l *Logger) Infof(fmt string, args ...any) + func (l *Logger) Infow(fmt string, args ...any) + func (l *Logger) Level() zapcore.Level + func (l *Logger) Name() string + func (l *Logger) Panic(args ...any) + func (l *Logger) Panicf(fmt string, args ...any) + func (l *Logger) Panicw(fmt string, args ...any) + func (l *Logger) RLDebug(r float64, args ...any) + func (l *Logger) RLDebugf(r float64, fmt string, args ...any) + func (l *Logger) RLError(r float64, args ...any) + func (l *Logger) RLErrorf(r float64, fmt string, args ...any) + func (l *Logger) RLInfo(r float64, args ...any) + func (l *Logger) RLInfof(r float64, fmt string, args ...any) + func (l *Logger) RLWarn(r float64, args ...any) + func (l *Logger) RLWarnf(r float64, fmt string, args ...any) + func (l *Logger) SetSugar(sugar *zap.SugaredLogger) + func (l *Logger) Sugar() *zap.SugaredLogger + func (l *Logger) Warn(args ...any) + func (l *Logger) Warnf(fmt string, args ...any) + func (l *Logger) Warnw(fmt string, args ...any) + type LoggerCtx interface + Debug func(args ...interface{}) + DebugCtx func(ctx context.Context, template string, args ...interface{}) + Debugf func(template string, args ...interface{}) + DebugfCtx func(ctx context.Context, template string, args ...interface{}) + Error func(args ...interface{}) + ErrorCtx func(ctx context.Context, template string, args ...interface{}) + Errorf func(template string, args ...interface{}) + ErrorfCtx func(ctx context.Context, template string, args ...interface{}) + Info func(args ...interface{}) + InfoCtx func(ctx context.Context, template string, args ...interface{}) + Infof func(template string, args ...interface{}) + InfofCtx func(ctx context.Context, template string, args ...interface{}) + Named func(name string) LoggerCtx + Warn func(args ...interface{}) + WarnCtx func(ctx context.Context, template string, args ...interface{}) + Warnf func(template string, args ...interface{}) + WarnfCtx func(ctx context.Context, template string, args ...interface{}) + With func(fields ...zap.Field) LoggerCtx + type Option struct + Compress bool + ErrorPath string + Flags int + Level string + MaxSize int + Path string + type SLogerOpt func(*Logger) + func WithRateLimiter(n float64, hint string) SLogerOpt + type Trace struct + SpanID string + TraceID string Other modules containing this package github.com/GuanceCloud/cliutils