Documentation
¶
Index ¶
- Constants
- type Config
- type OptionFunc
- func EnableExitOnFatal() OptionFunc
- func SetCacheSize2Logger(size int) OptionFunc
- func SetCacheSize2Report(size int) OptionFunc
- func SetEnableReport() OptionFunc
- func SetFormatterCfg2Logger(formatterCfg formatter.FormatterConfig) OptionFunc
- func SetFormatterCfg2Report(formatterCfg formatter.FormatterConfig) OptionFunc
- func SetFormatterType2Logger(typ formatter.FormatterType) OptionFunc
- func SetFormatterType2Report(typ formatter.FormatterType) OptionFunc
- func SetHandler2Logger(h handler.IHandler) OptionFunc
- func SetHandler2Report(h handler.IHandler) OptionFunc
- func SetHandlerCfg2Logger(hcfg handler.HandlerConfig) OptionFunc
- func SetHandlerCfg2Report(hcfg handler.HandlerConfig) OptionFunc
- func SetLevel2Logger(lvl level.LogLevel) OptionFunc
- func SetLevel2Report(lvl level.LogLevel) OptionFunc
- func SetLoggerName(name string) OptionFunc
- func SetStreamer2Logger(streamer handler.IStreamer) OptionFunc
- func SetStreamer2Report(streamer handler.IStreamer) OptionFunc
- func SetSyslogHandlerCfg2Logger(syslogCfg handler.SyslogHandlerConfig) OptionFunc
- func SetSyslogHandlerCfg2Report(syslogCfg handler.SyslogHandlerConfig) OptionFunc
Constants ¶
View Source
const ( PatternTemplateWithDefault = "%[LoggerName]s (%[Pid]d,%[RoutineId]d) %[DateTime]s.%[Msecs]d %[LevelName]s %[Caller]s %[Message]v" PatternTemplateWithSimple = "%[LevelName]s %[DateTime]s.%[Msecs]d %[Caller]s %[Message]v" PatternTemplateWithTrace = "<%[TradeId]s> %[LoggerName]s (%[Pid]d,%[RoutineId]d) %[DateTime]s %[LevelName]s %[Caller]s %[Message]v" )
View Source
const (
DefaultTimestampFormat = time.RFC3339
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
LoggerName string
LogHandlerConfig handler.HandlerConfig
ReportHandlerConfig handler.HandlerConfig
ExitFunc func(code int) // Function to exit the application, defaults to `os.Exit()`
TradeIDFunc func(entry *message.Entry) string
OnError func(msg *message.Entry, err error)
ReportCacheSize int
LoggerCacheSize int
LoggerLevel level.LogLevel
ReportLevel level.LogLevel
ExitOnFatal bool
ThrowOnPanic bool
IsRecordCaller bool
EnableReport bool
}
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type OptionFunc ¶
type OptionFunc func(config *Config)
func EnableExitOnFatal ¶ added in v0.2.3
func EnableExitOnFatal() OptionFunc
func SetCacheSize2Logger ¶
func SetCacheSize2Logger(size int) OptionFunc
func SetCacheSize2Report ¶
func SetCacheSize2Report(size int) OptionFunc
func SetEnableReport ¶
func SetEnableReport() OptionFunc
func SetFormatterCfg2Logger ¶ added in v0.3.1
func SetFormatterCfg2Logger(formatterCfg formatter.FormatterConfig) OptionFunc
func SetFormatterCfg2Report ¶ added in v0.3.1
func SetFormatterCfg2Report(formatterCfg formatter.FormatterConfig) OptionFunc
func SetFormatterType2Logger ¶ added in v0.2.0
func SetFormatterType2Logger(typ formatter.FormatterType) OptionFunc
func SetFormatterType2Report ¶ added in v0.2.0
func SetFormatterType2Report(typ formatter.FormatterType) OptionFunc
func SetHandler2Logger ¶ added in v0.3.1
func SetHandler2Logger(h handler.IHandler) OptionFunc
func SetHandler2Report ¶ added in v0.3.1
func SetHandler2Report(h handler.IHandler) OptionFunc
func SetHandlerCfg2Logger ¶ added in v0.3.1
func SetHandlerCfg2Logger(hcfg handler.HandlerConfig) OptionFunc
func SetHandlerCfg2Report ¶ added in v0.3.1
func SetHandlerCfg2Report(hcfg handler.HandlerConfig) OptionFunc
func SetLevel2Logger ¶
func SetLevel2Logger(lvl level.LogLevel) OptionFunc
func SetLevel2Report ¶
func SetLevel2Report(lvl level.LogLevel) OptionFunc
func SetLoggerName ¶
func SetLoggerName(name string) OptionFunc
SetLoggerName Set the name of the logger, the default is the name of the program.
func SetStreamer2Logger ¶ added in v0.2.0
func SetStreamer2Logger(streamer handler.IStreamer) OptionFunc
func SetStreamer2Report ¶ added in v0.2.0
func SetStreamer2Report(streamer handler.IStreamer) OptionFunc
func SetSyslogHandlerCfg2Logger ¶ added in v0.3.1
func SetSyslogHandlerCfg2Logger(syslogCfg handler.SyslogHandlerConfig) OptionFunc
func SetSyslogHandlerCfg2Report ¶ added in v0.3.1
func SetSyslogHandlerCfg2Report(syslogCfg handler.SyslogHandlerConfig) OptionFunc
Click to show internal directories.
Click to hide internal directories.