Documentation
¶
Index ¶
Constants ¶
View Source
const ( Ldate = 1 << iota // the date in the local time zone: 2009/01/23 Ltime // the time in the local time zone: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone LstdFlags = Ldate | Ltime // initial values for the standard logger )
refer import "log"
Variables ¶
View Source
var LogrusRegexp = regexp.MustCompile(`sirupsen/logrus(@.*)?/.*.go`)
View Source
var MiscRegexp = regexp.MustCompile(`zxfonline/misc(@.*)?/log/.*.go`)
View Source
var SuffixesToIgnoreArray = []*regexp.Regexp{ MiscRegexp, LogrusRegexp, }
Functions ¶
This section is empty.
Types ¶
type CallerHook ¶
type CallerHook struct {
CallerHookOptions *CallerHookOptions
}
func NewHook ¶
func NewHook(options *CallerHookOptions) *CallerHook
NewHook creates a new caller hook with options. If options are nil or unspecified, options.Field defaults to "src" and options.Flags defaults to log.Llongfile
func (*CallerHook) Levels ¶
func (hook *CallerHook) Levels() []logrus.Level
type CallerHookOptions ¶
type CallerHookOptions struct {
// new
FileAlias string //default:file
EnableFile bool
LineAlias string //default:line
EnableLine bool
// old
// Field to display caller info in
Field string
DisabledField bool
// Stores the flags
Flags int
}
CallerHookOptions stores caller hook options
func (*CallerHookOptions) HasFlag ¶
func (options *CallerHookOptions) HasFlag(flag int) bool
HasFlag returns true if the report caller options contains the specified flag
Click to show internal directories.
Click to hide internal directories.