Documentation ¶
Index ¶
- Constants
- Variables
- func GetLogLevel() logrus.Level
- func GetLogger() logrus.FieldLogger
- func InitializeDefaultLogger() (logger *logrus.Logger)
- func PopulateLogOpts(o LogOptions, level string, format string)
- func ResetLogOutput()
- func SetLogLevel(logLevel logrus.Level)
- func SetupLogging(o LogOptions, debug bool) error
- type DebugLogger
- type LogFormat
- type LogOptions
Constants ¶
View Source
const ( LevelOpt = "level" FormatOpt = "format" )
Variables ¶
View Source
var ( // DefaultLogger is the base logrus logger. It is different from the logrus // default to avoid external dependencies from writing out unexpectedly DefaultLogger = InitializeDefaultLogger() )
Functions ¶
func GetLogLevel ¶
func GetLogger ¶
func GetLogger() logrus.FieldLogger
GetLogger returns the DefaultLogger that was previously setup
func InitializeDefaultLogger ¶
InitializeDefaultLogger returns a logrus Logger with a custom text formatter.
func PopulateLogOpts ¶
func PopulateLogOpts(o LogOptions, level string, format string)
PopulateLogOpts populates the logger options making sure that passed values are valid.
func ResetLogOutput ¶
func ResetLogOutput()
func SetLogLevel ¶ added in v1.3.2
func SetupLogging ¶
func SetupLogging(o LogOptions, debug bool) error
SetupLogging setup logger options taking into consideration the debug flag.
Types ¶
type DebugLogger ¶ added in v1.3.2
type DebugLogger struct {
// contains filtered or unexported fields
}
func NewDebugLogger ¶ added in v1.3.2
func NewDebugLogger(logger logrus.FieldLogger, debugEnabled bool) *DebugLogger
func (*DebugLogger) Debug ¶ added in v1.3.2
func (d *DebugLogger) Debug(args ...interface{})
func (*DebugLogger) DebugLogWithCallers ¶ added in v1.3.2
func (d *DebugLogger) DebugLogWithCallers(nCallers int) logrus.FieldLogger
func (*DebugLogger) Debugf ¶ added in v1.3.2
func (d *DebugLogger) Debugf(fmt string, args ...interface{})
type LogOptions ¶
LogOptions maps configuration key-value pairs related to logging.
Click to show internal directories.
Click to hide internal directories.