Documentation ¶
Index ¶
- func AddGlobalFilter(f ...filter.Chain)
- func Alert(v ...interface{})
- func AlertEnabled() bool
- func Alertf(format string, v ...interface{})
- func Close() error
- func CloseAll() map[string]error
- func Critical(v ...interface{})
- func CriticalEnabled() bool
- func Criticalf(format string, v ...interface{})
- func Debug(v ...interface{})
- func DebugEnabled() bool
- func Debugf(format string, v ...interface{})
- func DefaultDynamicModuleName(enable bool)
- func DefaultLocation(loc *time.Location)
- func DefaultLogFormatter(f formatter.Formatter)
- func DefaultLogLevel(l level.Level)
- func DefaultLogWriter(w writer.Writer)
- func DefaultWithFileLine(enable bool)
- func Emergency(v ...interface{})
- func EmergencyEnabled() bool
- func Emergencyf(format string, v ...interface{})
- func Error(v ...interface{})
- func ErrorEnabled() bool
- func Errorf(format string, v ...interface{})
- func GlobalFields(f func(c event.Fields))
- func GlobalFilters() []filter.Chain
- func Info(v ...interface{})
- func InfoEnabled() bool
- func Infof(format string, v ...interface{})
- func Notice(v ...interface{})
- func NoticeEnabled() bool
- func Noticef(format string, v ...interface{})
- func ReOpen() error
- func ReOpenAll() map[string]error
- func Reset()
- func Warning(v ...interface{})
- func WarningEnabled() bool
- func Warningf(format string, v ...interface{})
- type AsteriaLogger
- func (module *AsteriaLogger) AddFilter(f ...filter.Chain)
- func (module *AsteriaLogger) Alert(v ...interface{})
- func (module *AsteriaLogger) AlertEnabled() bool
- func (module *AsteriaLogger) Alertf(format string, v ...interface{})
- func (module *AsteriaLogger) Close() error
- func (module *AsteriaLogger) Critical(v ...interface{})
- func (module *AsteriaLogger) CriticalEnabled() bool
- func (module *AsteriaLogger) Criticalf(format string, v ...interface{})
- func (module *AsteriaLogger) Debug(v ...interface{})
- func (module *AsteriaLogger) DebugEnabled() bool
- func (module *AsteriaLogger) Debugf(format string, v ...interface{})
- func (module *AsteriaLogger) DynamicModuleName(enable bool) *AsteriaLogger
- func (module *AsteriaLogger) Emergency(v ...interface{})
- func (module *AsteriaLogger) EmergencyEnabled() bool
- func (module *AsteriaLogger) Emergencyf(format string, v ...interface{})
- func (module *AsteriaLogger) Error(v ...interface{})
- func (module *AsteriaLogger) ErrorEnabled() bool
- func (module *AsteriaLogger) Errorf(format string, v ...interface{})
- func (module *AsteriaLogger) F(fields M) Logger
- func (module *AsteriaLogger) Filters() []filter.Chain
- func (module *AsteriaLogger) Formatter(f formatter.Formatter) *AsteriaLogger
- func (module *AsteriaLogger) GlobalFields(f func(c event.Fields)) *AsteriaLogger
- func (module *AsteriaLogger) Info(v ...interface{})
- func (module *AsteriaLogger) InfoEnabled() bool
- func (module *AsteriaLogger) Infof(format string, v ...interface{})
- func (module *AsteriaLogger) Location(loc *time.Location) *AsteriaLogger
- func (module *AsteriaLogger) LogLevel(le level.Level) *AsteriaLogger
- func (module *AsteriaLogger) Notice(v ...interface{})
- func (module *AsteriaLogger) NoticeEnabled() bool
- func (module *AsteriaLogger) Noticef(format string, v ...interface{})
- func (module *AsteriaLogger) Output(callDepth int, le level.Level, userContext Fields, v ...interface{})
- func (module *AsteriaLogger) Print(v ...interface{})
- func (module *AsteriaLogger) ReOpen() error
- func (module *AsteriaLogger) Warning(v ...interface{})
- func (module *AsteriaLogger) WarningEnabled() bool
- func (module *AsteriaLogger) Warningf(format string, v ...interface{})
- func (module *AsteriaLogger) With(data interface{}) Logger
- func (module *AsteriaLogger) WithFields(c Fields) Logger
- func (module *AsteriaLogger) WithFileLine(enable bool) *AsteriaLogger
- func (module *AsteriaLogger) Writer(w writer.Writer) *AsteriaLogger
- type ContextLogger
- func (logger *ContextLogger) Alert(v ...interface{})
- func (logger *ContextLogger) AlertEnabled() bool
- func (logger *ContextLogger) Alertf(format string, v ...interface{})
- func (logger *ContextLogger) Critical(v ...interface{})
- func (logger *ContextLogger) CriticalEnabled() bool
- func (logger *ContextLogger) Criticalf(format string, v ...interface{})
- func (logger *ContextLogger) Debug(v ...interface{})
- func (logger *ContextLogger) DebugEnabled() bool
- func (logger *ContextLogger) Debugf(format string, v ...interface{})
- func (logger *ContextLogger) Emergency(v ...interface{})
- func (logger *ContextLogger) EmergencyEnabled() bool
- func (logger *ContextLogger) Emergencyf(format string, v ...interface{})
- func (logger *ContextLogger) Error(v ...interface{})
- func (logger *ContextLogger) ErrorEnabled() bool
- func (logger *ContextLogger) Errorf(format string, v ...interface{})
- func (logger *ContextLogger) F(fields M) Logger
- func (logger *ContextLogger) Info(v ...interface{})
- func (logger *ContextLogger) InfoEnabled() bool
- func (logger *ContextLogger) Infof(format string, v ...interface{})
- func (logger *ContextLogger) Notice(v ...interface{})
- func (logger *ContextLogger) NoticeEnabled() bool
- func (logger *ContextLogger) Noticef(format string, v ...interface{})
- func (logger *ContextLogger) Warning(v ...interface{})
- func (logger *ContextLogger) WarningEnabled() bool
- func (logger *ContextLogger) Warningf(format string, v ...interface{})
- func (logger *ContextLogger) With(data interface{}) Logger
- func (logger *ContextLogger) WithFields(c Fields) Logger
- type DefaultConfig
- type Fields
- type Logger
- type Loggers
- func (loggers Loggers) DynamicModuleName(enable bool)
- func (loggers Loggers) Location(loc *time.Location)
- func (loggers Loggers) LogFormatter(f formatter.Formatter)
- func (loggers Loggers) LogLevel(le level.Level)
- func (loggers Loggers) LogWriter(w writer.Writer)
- func (loggers Loggers) WithFileLine(enable bool)
- type M
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlertEnabled ¶
func AlertEnabled() bool
func CriticalEnabled ¶
func CriticalEnabled() bool
func DebugEnabled ¶
func DebugEnabled() bool
func DefaultDynamicModuleName ¶
func DefaultDynamicModuleName(enable bool)
DefaultDynamicModuleName set if enable dynamic module name generate
func DefaultLocation ¶
DefaultLocation set default time location
func DefaultLogFormatter ¶
DefaultLogFormatter 设置全局默认的日志输出格式化器
func DefaultWithFileLine ¶
func DefaultWithFileLine(enable bool)
DefaultWithFileLine set whether output file & Line
func EmergencyEnabled ¶
func EmergencyEnabled() bool
func Emergencyf ¶
func Emergencyf(format string, v ...interface{})
func ErrorEnabled ¶
func ErrorEnabled() bool
func InfoEnabled ¶
func InfoEnabled() bool
func NoticeEnabled ¶
func NoticeEnabled() bool
func WarningEnabled ¶
func WarningEnabled() bool
Types ¶
type AsteriaLogger ¶
type AsteriaLogger struct {
// contains filtered or unexported fields
}
AsteriaLogger 日志对象
func (*AsteriaLogger) AddFilter ¶
func (module *AsteriaLogger) AddFilter(f ...filter.Chain)
AddFilter append a filter to logger
func (*AsteriaLogger) Alert ¶
func (module *AsteriaLogger) Alert(v ...interface{})
func (*AsteriaLogger) AlertEnabled ¶
func (module *AsteriaLogger) AlertEnabled() bool
func (*AsteriaLogger) Alertf ¶
func (module *AsteriaLogger) Alertf(format string, v ...interface{})
func (*AsteriaLogger) Close ¶
func (module *AsteriaLogger) Close() error
Close close a log LogWriter
func (*AsteriaLogger) Critical ¶
func (module *AsteriaLogger) Critical(v ...interface{})
func (*AsteriaLogger) CriticalEnabled ¶
func (module *AsteriaLogger) CriticalEnabled() bool
func (*AsteriaLogger) Criticalf ¶
func (module *AsteriaLogger) Criticalf(format string, v ...interface{})
func (*AsteriaLogger) Debug ¶
func (module *AsteriaLogger) Debug(v ...interface{})
func (*AsteriaLogger) DebugEnabled ¶
func (module *AsteriaLogger) DebugEnabled() bool
func (*AsteriaLogger) Debugf ¶
func (module *AsteriaLogger) Debugf(format string, v ...interface{})
func (*AsteriaLogger) DynamicModuleName ¶
func (module *AsteriaLogger) DynamicModuleName(enable bool) *AsteriaLogger
DynamicModuleName set whether enable dynamic module name generate
func (*AsteriaLogger) Emergency ¶
func (module *AsteriaLogger) Emergency(v ...interface{})
func (*AsteriaLogger) EmergencyEnabled ¶
func (module *AsteriaLogger) EmergencyEnabled() bool
func (*AsteriaLogger) Emergencyf ¶
func (module *AsteriaLogger) Emergencyf(format string, v ...interface{})
func (*AsteriaLogger) Error ¶
func (module *AsteriaLogger) Error(v ...interface{})
func (*AsteriaLogger) ErrorEnabled ¶
func (module *AsteriaLogger) ErrorEnabled() bool
func (*AsteriaLogger) Errorf ¶
func (module *AsteriaLogger) Errorf(format string, v ...interface{})
func (*AsteriaLogger) F ¶
func (module *AsteriaLogger) F(fields M) Logger
func (*AsteriaLogger) Filters ¶
func (module *AsteriaLogger) Filters() []filter.Chain
Filters return all filters
func (*AsteriaLogger) Formatter ¶
func (module *AsteriaLogger) Formatter(f formatter.Formatter) *AsteriaLogger
Formatter 设置日志格式化器
func (*AsteriaLogger) GlobalFields ¶
func (module *AsteriaLogger) GlobalFields(f func(c event.Fields)) *AsteriaLogger
GlobalFields set global fields
func (*AsteriaLogger) Info ¶
func (module *AsteriaLogger) Info(v ...interface{})
func (*AsteriaLogger) InfoEnabled ¶
func (module *AsteriaLogger) InfoEnabled() bool
func (*AsteriaLogger) Infof ¶
func (module *AsteriaLogger) Infof(format string, v ...interface{})
func (*AsteriaLogger) Location ¶
func (module *AsteriaLogger) Location(loc *time.Location) *AsteriaLogger
Location set time location for module
func (*AsteriaLogger) LogLevel ¶
func (module *AsteriaLogger) LogLevel(le level.Level) *AsteriaLogger
LogLevel 设置日志输出级别
func (*AsteriaLogger) Notice ¶
func (module *AsteriaLogger) Notice(v ...interface{})
func (*AsteriaLogger) NoticeEnabled ¶
func (module *AsteriaLogger) NoticeEnabled() bool
func (*AsteriaLogger) Noticef ¶
func (module *AsteriaLogger) Noticef(format string, v ...interface{})
func (*AsteriaLogger) Output ¶
func (module *AsteriaLogger) Output(callDepth int, le level.Level, userContext Fields, v ...interface{})
func (*AsteriaLogger) Print ¶
func (module *AsteriaLogger) Print(v ...interface{})
func (*AsteriaLogger) Warning ¶
func (module *AsteriaLogger) Warning(v ...interface{})
func (*AsteriaLogger) WarningEnabled ¶
func (module *AsteriaLogger) WarningEnabled() bool
func (*AsteriaLogger) Warningf ¶
func (module *AsteriaLogger) Warningf(format string, v ...interface{})
func (*AsteriaLogger) With ¶
func (module *AsteriaLogger) With(data interface{}) Logger
func (*AsteriaLogger) WithFields ¶
func (module *AsteriaLogger) WithFields(c Fields) Logger
WithFields 带有上下文信息的日志输出
func (*AsteriaLogger) WithFileLine ¶
func (module *AsteriaLogger) WithFileLine(enable bool) *AsteriaLogger
WithFileLine set whether output file & Line
func (*AsteriaLogger) Writer ¶
func (module *AsteriaLogger) Writer(w writer.Writer) *AsteriaLogger
Writer 设置日志输出器
type ContextLogger ¶
type ContextLogger struct {
// contains filtered or unexported fields
}
func (*ContextLogger) Alert ¶
func (logger *ContextLogger) Alert(v ...interface{})
func (*ContextLogger) AlertEnabled ¶
func (logger *ContextLogger) AlertEnabled() bool
func (*ContextLogger) Alertf ¶
func (logger *ContextLogger) Alertf(format string, v ...interface{})
func (*ContextLogger) Critical ¶
func (logger *ContextLogger) Critical(v ...interface{})
func (*ContextLogger) CriticalEnabled ¶
func (logger *ContextLogger) CriticalEnabled() bool
func (*ContextLogger) Criticalf ¶
func (logger *ContextLogger) Criticalf(format string, v ...interface{})
func (*ContextLogger) Debug ¶
func (logger *ContextLogger) Debug(v ...interface{})
func (*ContextLogger) DebugEnabled ¶
func (logger *ContextLogger) DebugEnabled() bool
func (*ContextLogger) Debugf ¶
func (logger *ContextLogger) Debugf(format string, v ...interface{})
func (*ContextLogger) Emergency ¶
func (logger *ContextLogger) Emergency(v ...interface{})
func (*ContextLogger) EmergencyEnabled ¶
func (logger *ContextLogger) EmergencyEnabled() bool
func (*ContextLogger) Emergencyf ¶
func (logger *ContextLogger) Emergencyf(format string, v ...interface{})
func (*ContextLogger) Error ¶
func (logger *ContextLogger) Error(v ...interface{})
func (*ContextLogger) ErrorEnabled ¶
func (logger *ContextLogger) ErrorEnabled() bool
func (*ContextLogger) Errorf ¶
func (logger *ContextLogger) Errorf(format string, v ...interface{})
func (*ContextLogger) F ¶
func (logger *ContextLogger) F(fields M) Logger
func (*ContextLogger) Info ¶
func (logger *ContextLogger) Info(v ...interface{})
func (*ContextLogger) InfoEnabled ¶
func (logger *ContextLogger) InfoEnabled() bool
func (*ContextLogger) Infof ¶
func (logger *ContextLogger) Infof(format string, v ...interface{})
func (*ContextLogger) Notice ¶
func (logger *ContextLogger) Notice(v ...interface{})
func (*ContextLogger) NoticeEnabled ¶
func (logger *ContextLogger) NoticeEnabled() bool
func (*ContextLogger) Noticef ¶
func (logger *ContextLogger) Noticef(format string, v ...interface{})
func (*ContextLogger) Warning ¶
func (logger *ContextLogger) Warning(v ...interface{})
func (*ContextLogger) WarningEnabled ¶
func (logger *ContextLogger) WarningEnabled() bool
func (*ContextLogger) Warningf ¶
func (logger *ContextLogger) Warningf(format string, v ...interface{})
func (*ContextLogger) With ¶
func (logger *ContextLogger) With(data interface{}) Logger
func (*ContextLogger) WithFields ¶
func (logger *ContextLogger) WithFields(c Fields) Logger
WithFields 带有上下文信息的日志输出
type DefaultConfig ¶
type DefaultConfig struct { LogLevel level.Level LogFormatter formatter.Formatter LogWriter writer.Writer TimeLocation *time.Location WithFileLine bool DynamicModuleName bool GlobalFields func(c event.Fields) GlobalFilters []filter.Chain }
DefaultConfig 默认配置对象
func GetDefaultConfig ¶
func GetDefaultConfig() DefaultConfig
GetDefaultConfig return default log config
type Logger ¶
type Logger interface { F(fields M) Logger WithFields(c Fields) Logger With(data interface{}) Logger Emergency(v ...interface{}) Alert(v ...interface{}) Critical(v ...interface{}) Error(v ...interface{}) Warning(v ...interface{}) Notice(v ...interface{}) Info(v ...interface{}) Debug(v ...interface{}) Emergencyf(format string, v ...interface{}) Alertf(format string, v ...interface{}) Criticalf(format string, v ...interface{}) Errorf(format string, v ...interface{}) Warningf(format string, v ...interface{}) Noticef(format string, v ...interface{}) Infof(format string, v ...interface{}) Debugf(format string, v ...interface{}) DebugEnabled() bool InfoEnabled() bool NoticeEnabled() bool WarningEnabled() bool ErrorEnabled() bool CriticalEnabled() bool AlertEnabled() bool EmergencyEnabled() bool }
func WithFields ¶
type Loggers ¶
type Loggers map[string]*AsteriaLogger
Loggers is a map holds all loggers
func (Loggers) DynamicModuleName ¶
DynamicModuleName set whether enable dynamic module name generate
func (Loggers) LogFormatter ¶
LogFormatter 设置全局默认的日志输出格式化器
func (Loggers) WithFileLine ¶
WithFileLine set whether output file & Line