Documentation ¶
Overview ¶
** description("Send logs to elasticsearch hook"). ** copyright('tuoyun,www.tuoyun.net'). ** author("fg,Gordon@tuoyun.net"). ** time(2021/3/26 17:05).
** description("get the name and line number of the calling file hook"). ** copyright('tuoyun,www.tuoyun.net'). ** author("fg,Gordon@tuoyun.net"). ** time(2021/3/16 11:26).
** description(""). ** copyright('tuoyun,www.tuoyun.net'). ** author("fg,Gordon@tuoyun.net"). ** time(2021/2/22 11:52).
Index ¶
- Constants
- func Debug(OperationID string, args ...interface{})
- func DebugByKv(tipInfo, OperationID string, args ...interface{})
- func Error(OperationID string, args ...interface{})
- func ErrorByArgs(format string, args ...interface{})
- func ErrorByKv(tipInfo, OperationID string, args ...interface{})
- func GetCurDayHalfTimeFormat() string
- func GetCurDayHalfTimestamp() int64
- func GetCurDayZeroTimeFormat() string
- func GetCurDayZeroTimestamp() int64
- func GetCurrentTimestamp() int64
- func GetTimeStampByFormat(datetime string) string
- func Info(OperationID string, args ...interface{})
- func InfoByArgs(format string, args ...interface{})
- func InfoByKv(tipInfo, OperationID string, args ...interface{})
- func NewDebug(OperationID string, args ...interface{})
- func NewError(OperationID string, args ...interface{})
- func NewInfo(OperationID string, args ...interface{})
- func NewLfsHook(rotationTime time.Duration, maxRemainNum uint, moduleName string) logrus.Hook
- func NewPrivateLog(moduleName string)
- func NewWarn(OperationID string, args ...interface{})
- func TimeStringFormatTimeUnix(timeFormat string, timeSrc string) int64
- func WarnByKv(tipInfo, OperationID string, args ...interface{})
- func Warning(token, OperationID, format string, args ...interface{})
- type Logger
Constants ¶
const ( TimeOffset = 8 * 3600 //8 hour offset HalfOffset = 12 * 3600 //Half-day hourly offset )
Variables ¶
This section is empty.
Functions ¶
func GetCurDayHalfTimeFormat ¶
func GetCurDayHalfTimeFormat() string
Get the formatted time at 12 o'clock of the day, the format is "2006-01-02_12-00-00"
func GetCurDayHalfTimestamp ¶
func GetCurDayHalfTimestamp() int64
Get the timestamp at 12 o'clock on the day
func GetCurDayZeroTimeFormat ¶
func GetCurDayZeroTimeFormat() string
Get the formatted time at 0 o'clock of the day, the format is "2006-01-02_00-00-00"
func GetCurDayZeroTimestamp ¶
func GetCurDayZeroTimestamp() int64
Get the current 0 o'clock timestamp
func GetTimeStampByFormat ¶
func InfoByKv ¶
func InfoByKv(tipInfo, OperationID string, args ...interface{})
Print log information in k, v format, kv is best to appear in pairs. tipInfo is the log prompt information for printing, and kv is the key and value for printing. Deprecated
func NewLfsHook ¶
func NewPrivateLog ¶
func NewPrivateLog(moduleName string)