Documentation ¶
Overview ¶
Just logrus wrapper, maybe replace in the future
Index ¶
- func AddHookFormatter(logger *logrus.Logger)
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func Logger() *logrus.Logger
- func Printf(format string, args ...interface{})
- func SetLogLevel(logger *logrus.Logger, level logrus.Level)
- func SetLogLevelByString(logger *logrus.Logger, lvl string) error
- func SetVerboseLevel(level int32)
- func Warningf(format string, args ...interface{})
- type TextFormatter
- type Verbose
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHookFormatter ¶
func SetVerboseLevel ¶
func SetVerboseLevel(level int32)
Types ¶
type TextFormatter ¶
type TextFormatter struct { // Set to true to bypass checking for a TTY before outputting colors ForceColors bool // Force disabling colors DisableColors bool // Disable timestamp logging, useful when output is redirected to logging // system that already adds timestamps DisableTimestamp bool // Enable logging of just the time passed since beginning of execution. ShortTimestamp bool // Timestamp format to use for display when a full timestamp is printed. TimestampFormat string // The fields are sorted by default for a consistent output. For applications // that log extremely frequently and don't use the JSON formatter this may not // be desired. DisableSorting bool // Pad msg field with spaces on the right for display. // The value for this parameter will be the size of padding. // Its default value is zero, which means no padding will be applied for msg. SpacePadding int }
type Verbose ¶
type Verbose bool
Verbose is a boolean type that implements Infof (like Printf) etc.
func V ¶
V reports whether verbosity at the call site is at least the requested level. The returned value is a boolean of type Verbose, which implements Infof, and Printf etc. These methods will write to the Info log if called. Thus, one may write either
if log.V(2) { log.Infof("log this") }
or
log.V(2).Infof("log this")
The second form is shorter but the first is cheaper if logging is off because it does not evaluate its arguments.
Whether an individual call to V generates a log record depends on the setting of the --log-level flags; both are off by default. If the level in the call to V is at least the value of --log-level for the source file containing the call, the V call will log.