Documentation ¶
Index ¶
- Constants
- func GoWaitError(log *XLog, c <-chan error, from string, s string)
- type Extend
- type LogInfo
- type LogLevel
- type LogPrint
- type LogRecordStrategy
- type LogSetting
- type LogStrategy
- type Printer
- type PushInfo
- type XLog
- func (receiver *XLog) Debug(from string, format string, a ...interface{})
- func (receiver *XLog) Error(from string, format string, a ...interface{})
- func (receiver *XLog) ErrorErr(from string, err error)
- func (receiver *XLog) Info(from string, format string, a ...interface{})
- func (receiver *XLog) Init(setting LogSetting) error
- func (receiver *XLog) Log(level LogLevel, from string, info string)
- func (receiver *XLog) Misc(from string, format string, a ...interface{})
- func (receiver *XLog) Warning(from string, format string, a ...interface{})
- func (receiver *XLog) WarningErr(from string, err error)
Constants ¶
View Source
const ( ErrPrintFail = misc.ErrStr("print failed") ErrPushFail = misc.ErrStr("push failed") ErrPushPushDeerFail = misc.ErrStr("push failed") ErrPushEmailFail = misc.ErrStr("push failed") ErrPushDingFail = misc.ErrStr("push failed") ErrFileFail = misc.ErrStr("file failed") ErrNoLogWay = misc.ErrStr("no log way") )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogRecordStrategy ¶
type LogSetting ¶
type LogSetting struct { LogInfo LogPrint LogStrategy LogRecordStrategy PushInfo Extend }
type LogStrategy ¶
type XLog ¶
type XLog struct { LogSetting misc.InitTag }
XLog 日志管理器,支持以对应策略记录日志。目前暂不支持复杂策略,可以考虑组合使用多个xLog来实现
func (*XLog) Init ¶
func (receiver *XLog) Init(setting LogSetting) error
func (*XLog) Log ¶
Log 记录一条日志, from 中应填入来源模块的大写, 例如from = "TEST",则日志中会显示[TEST],用于区分来源 因为别的模块的error处理等都是通过日志模块来进行的,所以日志模块的错误处理只能通过print来进行
func (*XLog) WarningErr ¶
Click to show internal directories.
Click to hide internal directories.