Documentation ¶
Index ¶
- Constants
- Variables
- func Adjust(logger *zap.Logger, options ...zap.Option) *zap.Logger
- func ConnectionIdField(val uint32) zap.Field
- func Debug(msg string, fields ...zap.Field)
- func Debugf(msg string, fields ...interface{})
- func Discardable() zap.Field
- func DragonboatFactory(name string) logger.ILogger
- func EnableLog() bool
- func EnableStoreDB() bool
- func Error(msg string, fields ...zap.Field)
- func ErrorField(err error) zap.Field
- func Errorf(msg string, fields ...interface{})
- func Fatal(msg string, fields ...zap.Field)
- func Fatalf(msg string, fields ...interface{})
- func GetContextFieldFunc() contextFieldFunc
- func GetCronLogger(logInfo bool) cron.Logger
- func GetErrorLogger() *zap.Logger
- func GetGlobalLogger() *zap.Logger
- func GetLogger(options ...zap.Option) *zap.Logger
- func GetLoggerWithOptions(level zapcore.LevelEnabler, encoder zapcore.Encoder, ...) *zap.Logger
- func GetPanicLogger(options ...zap.Option) *zap.Logger
- func GetPanicLoggerWithLevel(level zapcore.Level, options ...zap.Option) *zap.Logger
- func GetReportZapFunc() reportZapFunc
- func GetS3Logger() logging.Logger
- func GetSkip1Logger() *zap.Logger
- func Info(msg string, fields ...zap.Field)
- func Infof(msg string, fields ...interface{})
- func LogAsyncTask(logger *zap.Logger, task string, fields ...zap.Field) func()
- func LogClose(logger *zap.Logger, components string, fields ...zap.Field) func()
- func NoReportFiled() zap.Field
- func Panic(msg string, fields ...zap.Field)
- func Panicf(msg string, fields ...interface{})
- func PathField(val string) zap.Field
- func QueryField(val string) zap.Field
- func SetLogReporter(r *TraceReporter)
- func SetupMOLogger(conf *LogConfig)
- func StatementField(val string) zap.Field
- func StatusField(val string) zap.Field
- func TableField(val string) zap.Field
- func VarsField(val string) zap.Field
- func Warn(msg string, fields ...zap.Field)
- func Warnf(msg string, fields ...interface{})
- type CronLogger
- type DragonboatAdaptLogger
- func (d DragonboatAdaptLogger) Debugf(format string, args ...interface{})
- func (d DragonboatAdaptLogger) Errorf(format string, args ...interface{})
- func (d DragonboatAdaptLogger) Infof(format string, args ...interface{})
- func (d DragonboatAdaptLogger) Panicf(format string, args ...interface{})
- func (d *DragonboatAdaptLogger) SetLevel(level logger.LogLevel)
- func (d DragonboatAdaptLogger) Warningf(format string, args ...interface{})
- type GoettyLogger
- type LogConfig
- type S3Logger
- type TraceLogEncoder
- type TraceReporter
- type ZapSink
Constants ¶
const MOInternalFiledKeyDiscardable = "MODiscardable"
MOInternalFiledKeyDiscardable mark
const MOInternalFiledKeyNoopReport = "MOInternalFiledKeyNoopReport"
Variables ¶
var SpanFieldKey atomic.Value
Functions ¶
func ConnectionIdField ¶ added in v0.6.0
func Discardable ¶ added in v1.0.0
func DragonboatFactory ¶ added in v0.6.0
DragonboatFactory implement logger.Factory for logger.SetLoggerFactory create DragonboatAdaptLogger intance
func EnableStoreDB ¶ added in v0.6.0
func EnableStoreDB() bool
func ErrorField ¶ added in v0.6.0
func GetContextFieldFunc ¶ added in v0.6.0
func GetContextFieldFunc() contextFieldFunc
func GetCronLogger ¶ added in v0.6.0
func GetCronLogger(logInfo bool) cron.Logger
func GetErrorLogger ¶ added in v0.6.0
func GetGlobalLogger ¶
GetGlobalLogger returns the current global zap Logger.
func GetLoggerWithOptions ¶ added in v0.5.0
func GetLoggerWithOptions( level zapcore.LevelEnabler, encoder zapcore.Encoder, syncer zapcore.WriteSyncer, options ...zap.Option) *zap.Logger
GetLoggerWithOptions get default zap logger
func GetPanicLogger ¶ added in v0.5.0
GetPanicLogger returns a zap logger which will panic on Fatal(). The returned zap logger should only be used in tests.
func GetPanicLoggerWithLevel ¶ added in v0.5.0
GetPanicLoggerWithLevel returns a zap logger which will panic on Fatal(). The returned zap logger should only be used in tests.
func GetReportZapFunc ¶ added in v0.6.0
func GetReportZapFunc() reportZapFunc
func GetS3Logger ¶ added in v0.6.0
func GetSkip1Logger ¶ added in v0.6.0
func LogAsyncTask ¶ added in v0.6.0
LogAsyncTask used to log any async task, and will write a log if the async task exited.
func NoReportFiled ¶ added in v0.6.0
func QueryField ¶ added in v0.6.0
func SetLogReporter ¶ added in v0.6.0
func SetLogReporter(r *TraceReporter)
func SetupMOLogger ¶
func SetupMOLogger(conf *LogConfig)
SetupMOLogger sets up the global logger for MO Server.
func StatementField ¶ added in v0.6.0
func StatusField ¶ added in v0.6.0
func TableField ¶ added in v0.6.0
Types ¶
type CronLogger ¶ added in v0.6.0
type CronLogger struct { *zap.SugaredLogger // contains filtered or unexported fields }
func (*CronLogger) Error ¶ added in v0.6.0
func (l *CronLogger) Error(err error, msg string, keysAndValues ...any)
Error implement cron.Logger
func (*CronLogger) Info ¶ added in v0.6.0
func (l *CronLogger) Info(msg string, keysAndValues ...any)
Info implement cron.Logger
type DragonboatAdaptLogger ¶ added in v0.6.0
type DragonboatAdaptLogger struct {
// contains filtered or unexported fields
}
func (DragonboatAdaptLogger) Debugf ¶ added in v0.6.0
func (d DragonboatAdaptLogger) Debugf(format string, args ...interface{})
func (DragonboatAdaptLogger) Errorf ¶ added in v0.6.0
func (d DragonboatAdaptLogger) Errorf(format string, args ...interface{})
func (DragonboatAdaptLogger) Infof ¶ added in v0.6.0
func (d DragonboatAdaptLogger) Infof(format string, args ...interface{})
func (DragonboatAdaptLogger) Panicf ¶ added in v0.6.0
func (d DragonboatAdaptLogger) Panicf(format string, args ...interface{})
func (*DragonboatAdaptLogger) SetLevel ¶ added in v0.6.0
func (d *DragonboatAdaptLogger) SetLevel(level logger.LogLevel)
func (DragonboatAdaptLogger) Warningf ¶ added in v0.6.0
func (d DragonboatAdaptLogger) Warningf(format string, args ...interface{})
type GoettyLogger ¶
type GoettyLogger struct{}
func (*GoettyLogger) Debugf ¶
func (l *GoettyLogger) Debugf(msg string, fields ...interface{})
func (*GoettyLogger) Errorf ¶
func (l *GoettyLogger) Errorf(msg string, fields ...interface{})
func (*GoettyLogger) Fatalf ¶
func (l *GoettyLogger) Fatalf(msg string, fields ...interface{})
func (*GoettyLogger) Infof ¶
func (l *GoettyLogger) Infof(msg string, fields ...interface{})
type LogConfig ¶ added in v0.5.0
type LogConfig struct { Level string `toml:"level"` Format string `toml:"format"` Filename string `toml:"filename"` MaxSize int `toml:"max-size"` MaxDays int `toml:"max-days"` MaxBackups int `toml:"max-backups"` // DisableStore ctrl store log into db DisableStore bool `toml:"disable-store"` // DisableLog ctrl log into console DisableLog bool `toml:"disable-log"` // StacktraceLevel StacktraceLevel string `toml:"stacktrace-level"` }
type TraceLogEncoder ¶ added in v0.6.0
func (*TraceLogEncoder) AddBool ¶ added in v1.0.0
func (e *TraceLogEncoder) AddBool(key string, value bool)
AddBool implements zapcore.ObjectEncoder, hook zapcore.Core's With(...) api
func (*TraceLogEncoder) AddObject ¶ added in v0.6.0
func (e *TraceLogEncoder) AddObject(key string, val zapcore.ObjectMarshaler) error
func (*TraceLogEncoder) Clone ¶ added in v0.6.0
func (e *TraceLogEncoder) Clone() zapcore.Encoder
func (*TraceLogEncoder) EncodeEntry ¶ added in v0.6.0
type TraceReporter ¶ added in v0.6.0
type TraceReporter struct { ReportZap reportZapFunc ContextField contextFieldFunc }