Documentation ¶
Index ¶
- func CreateLocation(skip int) *location.Location
- func CreateLocationChainReverse(skip int) []*location.Location
- func ErrorLog(err *errors.Error, params ...interface{}) error
- func ErrorLogWithLocation(err *errors.Error, invoker []*location.Location, params ...interface{}) error
- func FatalLog(err *errors.Error, params ...interface{}) error
- func FatalLogWithLocation(err *errors.Error, invoker []*location.Location, params ...interface{}) error
- func GinLog() gin.HandlerFunc
- func GinLogger() gin.HandlerFunc
- func InfoLog(info string, params ...interface{})
- func InfoLogWithLocation(invoker *location.Location, info string, params ...interface{})
- func Init(environment string, service string)
- func InitDefault()
- func Stop()
- func Timer() func() time.Duration
- func WarnLog(err *errors.Error, params ...interface{}) error
- func WarnLogWithLocation(err *errors.Error, invoker []*location.Location, params ...interface{}) error
- type BufferLog
- type CbFuncMap
- type ConsoleLog
- type EsLog
- type FluentLog
- type GinMsg
- func (msg *GinMsg) GetLevel() Level
- func (msg *GinMsg) GetType() Kind
- func (msg *GinMsg) ToAlarm(attach map[string]interface{}) string
- func (msg *GinMsg) ToColorfulContent() string
- func (msg *GinMsg) ToContent() string
- func (msg *GinMsg) ToJson() string
- func (msg *GinMsg) ToMap() map[string]interface{}
- type ILog
- type IMsg
- type ISchedule
- type Kind
- type Level
- type LogStashLog
- type Logger
- func (l *Logger) ErrorLog(err *errors.Error, invoker []*location.Location, params ...interface{}) error
- func (l *Logger) FatalLog(err *errors.Error, invoker []*location.Location, params ...interface{}) error
- func (l *Logger) InfoLog(invoker []*location.Location, info string, params ...interface{})
- func (l *Logger) Log(msg IMsg)
- func (l *Logger) Stop()
- func (l *Logger) WarnLog(err *errors.Error, invoker []*location.Location, params ...interface{}) error
- type MongoLog
- type Msg
- type SpecSchedule
- type SpecTimeSchedule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateLocation ¶
func ErrorLogWithLocation ¶
func FatalLogWithLocation ¶
func GinLogger ¶
func GinLogger() gin.HandlerFunc
func InfoLogWithLocation ¶
func InitDefault ¶
func InitDefault()
Types ¶
type BufferLog ¶
type BufferLog struct {
// contains filtered or unexported fields
}
func NewBufferLog ¶
type CbFuncMap ¶
type CbFuncMap struct {
// contains filtered or unexported fields
}
func NewCbFuncMap ¶
func NewCbFuncMap() *CbFuncMap
type ConsoleLog ¶
type ConsoleLog struct {
// contains filtered or unexported fields
}
func NewConsoleLog ¶
func NewConsoleLog() *ConsoleLog
func (*ConsoleLog) Stop ¶
func (c *ConsoleLog) Stop()
func (*ConsoleLog) Write ¶
func (c *ConsoleLog) Write(msg IMsg)
type FluentLog ¶
type FluentLog struct {
// contains filtered or unexported fields
}
func NewFluentLog ¶
func NewFluentLog() *FluentLog
type GinMsg ¶
type GinMsg struct { Service string // 服务名 LogType Kind // 日志类型 ErrorMessage string // 信息 CreateTime time.Time // 创建时间 Path string // 访问路径 RawQuery string // 参数 Body string // 主题 Latency time.Duration // 执行时长 ClientIP string // 请求ip StatusCode int // HTTP状态码 Method string // 方法名 }
func (*GinMsg) ToColorfulContent ¶
type ISchedule ¶
type ISchedule interface { GetAddTime() time.Time // 获取添加时间 AddExecuteCount() // 添加执行次数 任务执行完毕后调用 GetExecuteCount() int // 获取执行次数 Expression() (nt time.Time, isValid bool) // 表达式 ToString() string }
任务调度接口
type LogStashLog ¶
type LogStashLog struct {
// contains filtered or unexported fields
}
+---------------------------------------------------------+ + + + LogStashLog + + + +---------------------------------------------------------+
使用logstash
func NewLogStashLog ¶
func (*LogStashLog) Stop ¶
func (c *LogStashLog) Stop()
func (*LogStashLog) Write ¶
func (c *LogStashLog) Write(msg IMsg)
type Logger ¶
func (*Logger) ErrorLog ¶
func (l *Logger) ErrorLog(err *errors.Error, invoker []*location.Location, params ...interface{}) error
错误日志接口
func (*Logger) FatalLog ¶
func (l *Logger) FatalLog(err *errors.Error, invoker []*location.Location, params ...interface{}) error
致命日志接口
type MongoLog ¶
type MongoLog struct {
// contains filtered or unexported fields
}
+---------------------------------------------------------+ + + + MongoLog + + + +---------------------------------------------------------+
使用mongo
func NewMongoLog ¶
type Msg ¶
type Msg struct { Service string LogType Kind // 日志类型 Locations []*location.Location // 定位 Level Level // 报错级别 Error *errors.Error // 错误抽象 LogDetail string // 详细信息 Parameter []interface{} // 参数 CreateTime time.Time // 创建时间 }
日志信息
func NewErrorMsg ¶
func NewErrorMsg(service string, level Level, err *errors.Error, locations []*location.Location, v ...interface{}) *Msg
创建一个错误日志记录
func NewInfoMsg ¶
func NewInfoMsg(service string, locations []*location.Location, detail string, params ...interface{}) *Msg
创建一个日志记录
func (*Msg) ToColorfulContent ¶
type SpecSchedule ¶
type SpecSchedule struct {
// contains filtered or unexported fields
}
指定时长循环调度
func NewSpecSchedule ¶
func (*SpecSchedule) AddExecuteCount ¶
func (p *SpecSchedule) AddExecuteCount()
func (*SpecSchedule) Expression ¶
func (p *SpecSchedule) Expression() (nt time.Time, isValid bool)
func (*SpecSchedule) GetAddTime ¶
func (p *SpecSchedule) GetAddTime() time.Time
func (*SpecSchedule) GetExecuteCount ¶
func (p *SpecSchedule) GetExecuteCount() int
func (*SpecSchedule) ToString ¶
func (p *SpecSchedule) ToString() string
type SpecTimeSchedule ¶
type SpecTimeSchedule struct {
// contains filtered or unexported fields
}
指定时长指定次数调度器
func NewSpecTimeSchedule ¶
func NewSpecTimeSchedule(spec time.Duration, limit int) *SpecTimeSchedule
func (*SpecTimeSchedule) AddExecuteCount ¶
func (p *SpecTimeSchedule) AddExecuteCount()
func (*SpecTimeSchedule) Expression ¶
func (p *SpecTimeSchedule) Expression() (nt time.Time, isValid bool)
func (*SpecTimeSchedule) GetAddTime ¶
func (p *SpecTimeSchedule) GetAddTime() time.Time
func (*SpecTimeSchedule) GetExecuteCount ¶
func (p *SpecTimeSchedule) GetExecuteCount() int
func (*SpecTimeSchedule) ToString ¶
func (p *SpecTimeSchedule) ToString() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.