log

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Overview

** 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

View Source
const (
	TimeOffset = 8 * 3600  //8 hour offset
	HalfOffset = 12 * 3600 //Half-day hourly offset
)

Variables

This section is empty.

Functions

func Debug

func Debug(OperationID string, args ...interface{})

func DebugByKv

func DebugByKv(tipInfo, OperationID string, args ...interface{})

Deprecated

func Error

func Error(OperationID string, args ...interface{})

func ErrorByArgs

func ErrorByArgs(format string, args ...interface{})

Deprecated

func ErrorByKv

func ErrorByKv(tipInfo, OperationID string, args ...interface{})

Deprecated

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 GetCurrentTimestamp

func GetCurrentTimestamp() int64

Get the current timestamp

func GetTimeStampByFormat

func GetTimeStampByFormat(datetime string) string

func Info

func Info(OperationID string, args ...interface{})

func InfoByArgs

func InfoByArgs(format string, args ...interface{})

Deprecated

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 NewDebug

func NewDebug(OperationID string, args ...interface{})

func NewError

func NewError(OperationID string, args ...interface{})

func NewInfo

func NewInfo(OperationID string, args ...interface{})

func NewLfsHook

func NewLfsHook(rotationTime time.Duration, maxRemainNum uint, moduleName string) logrus.Hook

func NewPrivateLog

func NewPrivateLog(moduleName string, storageLocation string, rotationTime int, remainRotationCount uint, remainLogLevel uint)

func NewWarn

func NewWarn(OperationID string, args ...interface{})

func TimeStringFormatTimeUnix

func TimeStringFormatTimeUnix(timeFormat string, timeSrc string) int64

func WarnByKv

func WarnByKv(tipInfo, OperationID string, args ...interface{})

Deprecated

func Warning

func Warning(token, OperationID, format string, args ...interface{})

Deprecated

Types

type Config

type Config struct {
	StorageLocation       string
	RotationTime          int
	RemainRotationCount   uint
	RemainLogLevel        uint
	ElasticSearchSwitch   bool
	ElasticSearchAddr     []string
	ElasticSearchUser     string
	ElasticSearchPassword string
}

type Logger

type Logger struct {
	*logrus.Logger
	Pid int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL