Documentation ¶
Index ¶
- func Debug(v interface{})
- func Debugf(format string, v ...interface{})
- func Error(v interface{})
- func Errorf(format string, v ...interface{})
- func Info(v interface{})
- func Infof(format string, v ...interface{})
- func IsDebugEnabled() bool
- func IsTraceEnabled() bool
- func SetupLogger(logConfig *LogConfig, componentPrefix string) (io.WriteCloser, error)
- func Trace(v ...interface{})
- func Tracef(format string, v ...interface{})
- func Warn(v interface{})
- func Warnf(format string, v ...interface{})
- type LogConfig
- type LogLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf logs the given formatted message, if level is >= DEBUG
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf logs the given formatted message, if level is >= ERROR
func Infof ¶
func Infof(format string, v ...interface{})
Infof logs the given formatted message, if level is >= INFO
func IsDebugEnabled ¶
func IsDebugEnabled() bool
IsDebugEnabled returns true if log level is above DEBUG
func IsTraceEnabled ¶
func IsTraceEnabled() bool
IsTraceEnabled returns true if log level is above TRACE
func SetupLogger ¶
func SetupLogger(logConfig *LogConfig, componentPrefix string) (io.WriteCloser, error)
SetupLogger initializes logger with the provided configuration
Types ¶
type LogConfig ¶
type LogConfig struct { LogFile string `json:"logFile,omitempty" def:"{logFile}" descr:"Log file location in storage directory"` LogLevel string `json:"logLevel,omitempty" def:"INFO" descr:"Log levels are ERROR, WARN, INFO, DEBUG, TRACE"` LogFileSize int `json:"logFileSize,omitempty" def:"2" descr:"Log file size in MB before it gets rotated"` LogFileCount int `json:"logFileCount,omitempty" def:"5" descr:"Log file max rotations count"` LogFileMaxAge int `json:"logFileMaxAge,omitempty" def:"28" descr:"Log file rotations max age in days"` }
LogConfig contains logging configuration
Click to show internal directories.
Click to hide internal directories.