Documentation ¶
Index ¶
- Variables
- func ConfigureLogger(conf Logger)
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Errorln(args ...interface{})
- func GetLogger() *logrus.Logger
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func Infoln(args ...interface{})
- func Warning(args ...interface{})
- func Warningf(format string, args ...interface{})
- func Warningln(args ...interface{})
- type Entry
- type Fields
- type JSONFormatConfig
- type Logger
- type TextFormatConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugLevel = logrus.DebugLevel
View Source
var ErrorLevel = logrus.ErrorLevel
View Source
var FatalLevel = logrus.FatalLevel
View Source
var InfoLevel = logrus.InfoLevel
View Source
var PanicLevel = logrus.PanicLevel
View Source
var TraceLevel = logrus.TraceLevel
View Source
var WarnLevel = logrus.WarnLevel
Functions ¶
func ConfigureLogger ¶
func ConfigureLogger(conf Logger)
ConfigureLogger configures the global and local logrus logger
Types ¶
type Entry ¶
Entry is a logrus.Entry
func Sub ¶
Sub is a shortcut for log.WithFields(log.Fields{"namespace": ns}), it creates a new logger which inherits the parent's configuration but changes the namespace.
func WithFields ¶
WithFields creates an entry from the standard logger and adds multiple fields to it.
type JSONFormatConfig ¶
JSONFormatConfig provides configuration for the JSON logger format.
type Logger ¶
type Logger struct { Level string Formatter string OutputFile string JSONFormat JSONFormatConfig TextFormat TextFormatConfig }
Logger provides configuration for a logger.
func DefaultLoggerConfig ¶
func DefaultLoggerConfig() Logger
DefaultLoggerConfig returns a Logger instance with default values.
type TextFormatConfig ¶
type TextFormatConfig 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 // TimestampFormat 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 Indent string }
TextFormatConfig provides configuration for the text logger format.
Click to show internal directories.
Click to hide internal directories.