Documentation ¶
Index ¶
- Variables
- func Crit(msg string, args ...interface{})
- func Debug(msg string, args ...interface{})
- func Destroy() error
- func Err(msg string, args ...interface{})
- func GetLogLevel() common.LogLevel
- func GetLoggerObj() *log.Logger
- func GetType() string
- func Info(msg string, args ...interface{})
- func LogRotate() error
- func SetConfig(config common.LogConfig) error
- func SetDefaultLogger(name string, config common.LogConfig) error
- func SetLogFile(name string) error
- func SetLogFileCount(count int)
- func SetLogLevel(lvl common.LogLevel)
- func SetMaxLogSize(size int)
- func TimeTrack(start time.Time, location string, name string)
- func TimeTrackDiff(diff time.Duration, location string, name string)
- func TimeTracker() bool
- func Trace(msg string, args ...interface{})
- func Warn(msg string, args ...interface{})
- type BaseLogger
- func (l *BaseLogger) Crit(format string, args ...interface{})
- func (l *BaseLogger) Debug(format string, args ...interface{})
- func (l *BaseLogger) Destroy() error
- func (l *BaseLogger) Err(format string, args ...interface{})
- func (l *BaseLogger) GetLogLevel() common.LogLevel
- func (l *BaseLogger) GetLoggerObj() *log.Logger
- func (l *BaseLogger) GetType() string
- func (l *BaseLogger) Info(format string, args ...interface{})
- func (l *BaseLogger) LogRotate() error
- func (l *BaseLogger) SetLogFile(name string) error
- func (l *BaseLogger) SetLogFileCount(count int)
- func (l *BaseLogger) SetLogLevel(level common.LogLevel)
- func (l *BaseLogger) SetMaxLogSize(size int)
- func (l *BaseLogger) Trace(format string, args ...interface{})
- func (l *BaseLogger) Warn(format string, args ...interface{})
- type LogFileConfig
- type Logger
- type SilentLogger
- func (*SilentLogger) Crit(_ string, _ ...interface{})
- func (*SilentLogger) Debug(_ string, _ ...interface{})
- func (*SilentLogger) Destroy() error
- func (*SilentLogger) Err(_ string, _ ...interface{})
- func (*SilentLogger) GetLogLevel() common.LogLevel
- func (*SilentLogger) GetLoggerObj() *log.Logger
- func (*SilentLogger) GetType() string
- func (*SilentLogger) Info(_ string, _ ...interface{})
- func (*SilentLogger) LogRotate() error
- func (*SilentLogger) SetLogFile(_ string) error
- func (*SilentLogger) SetLogFileCount(_ int)
- func (*SilentLogger) SetLogLevel(_ common.LogLevel)
- func (*SilentLogger) SetMaxLogSize(_ int)
- func (*SilentLogger) Trace(_ string, _ ...interface{})
- func (*SilentLogger) Warn(_ string, _ ...interface{})
- type SysLogger
- func (l *SysLogger) Crit(format string, args ...interface{})
- func (l *SysLogger) Debug(format string, args ...interface{})
- func (l *SysLogger) Destroy() error
- func (l *SysLogger) Err(format string, args ...interface{})
- func (l *SysLogger) GetLogLevel() common.LogLevel
- func (l *SysLogger) GetLoggerObj() *log.Logger
- func (l *SysLogger) GetType() string
- func (l *SysLogger) Info(format string, args ...interface{})
- func (l *SysLogger) LogRotate() error
- func (l *SysLogger) SetLogFile(name string) error
- func (l *SysLogger) SetLogFileCount(count int)
- func (l *SysLogger) SetLogLevel(level common.LogLevel)
- func (l *SysLogger) SetMaxLogSize(size int)
- func (l *SysLogger) Trace(format string, args ...interface{})
- func (l *SysLogger) Warn(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var NoSyslogService = errors.New("failed to create syslog object")
Functions ¶
func GetLogLevel ¶
func GetLoggerObj ¶
func SetLogFile ¶
func SetLogFileCount ¶
func SetLogFileCount(count int)
func SetMaxLogSize ¶
func SetMaxLogSize(size int)
func TimeTrackDiff ¶
TimeTracker : Dump time taken by a call
func TimeTracker ¶
func TimeTracker() bool
Types ¶
type BaseLogger ¶
type BaseLogger struct {
// contains filtered or unexported fields
}
func (*BaseLogger) Crit ¶
func (l *BaseLogger) Crit(format string, args ...interface{})
func (*BaseLogger) Debug ¶
func (l *BaseLogger) Debug(format string, args ...interface{})
func (*BaseLogger) Destroy ¶
func (l *BaseLogger) Destroy() error
func (*BaseLogger) Err ¶
func (l *BaseLogger) Err(format string, args ...interface{})
func (*BaseLogger) GetLogLevel ¶
func (l *BaseLogger) GetLogLevel() common.LogLevel
func (*BaseLogger) GetLoggerObj ¶
func (l *BaseLogger) GetLoggerObj() *log.Logger
func (*BaseLogger) GetType ¶
func (l *BaseLogger) GetType() string
func (*BaseLogger) Info ¶
func (l *BaseLogger) Info(format string, args ...interface{})
func (*BaseLogger) LogRotate ¶
func (l *BaseLogger) LogRotate() error
func (*BaseLogger) SetLogFile ¶
func (l *BaseLogger) SetLogFile(name string) error
func (*BaseLogger) SetLogFileCount ¶
func (l *BaseLogger) SetLogFileCount(count int)
func (*BaseLogger) SetLogLevel ¶
func (l *BaseLogger) SetLogLevel(level common.LogLevel)
func (*BaseLogger) SetMaxLogSize ¶
func (l *BaseLogger) SetMaxLogSize(size int)
func (*BaseLogger) Trace ¶
func (l *BaseLogger) Trace(format string, args ...interface{})
func (*BaseLogger) Warn ¶
func (l *BaseLogger) Warn(format string, args ...interface{})
type LogFileConfig ¶
type LogFileConfig struct { LogFile string LogSize uint64 LogFileCount int LogLevel common.LogLevel LogTag string // contains filtered or unexported fields }
LogConfig : Configuration to be provided to logging infra
type Logger ¶
type Logger interface { GetLoggerObj() *log.Logger SetLogFile(name string) error SetMaxLogSize(size int) SetLogFileCount(count int) SetLogLevel(level common.LogLevel) Destroy() error GetType() string GetLogLevel() common.LogLevel Debug(format string, args ...interface{}) Trace(format string, args ...interface{}) Info(format string, args ...interface{}) Warn(format string, args ...interface{}) Err(format string, args ...interface{}) Crit(format string, args ...interface{}) LogRotate() error }
Logger : Interface to define a generic Logger. Implement this to create your new logging lib
type SilentLogger ¶
type SilentLogger struct { }
func (*SilentLogger) Crit ¶
func (*SilentLogger) Crit(_ string, _ ...interface{})
func (*SilentLogger) Debug ¶
func (*SilentLogger) Debug(_ string, _ ...interface{})
func (*SilentLogger) Destroy ¶
func (*SilentLogger) Destroy() error
func (*SilentLogger) Err ¶
func (*SilentLogger) Err(_ string, _ ...interface{})
func (*SilentLogger) GetLogLevel ¶
func (*SilentLogger) GetLogLevel() common.LogLevel
func (*SilentLogger) GetLoggerObj ¶
func (*SilentLogger) GetLoggerObj() *log.Logger
func (*SilentLogger) GetType ¶
func (*SilentLogger) GetType() string
func (*SilentLogger) Info ¶
func (*SilentLogger) Info(_ string, _ ...interface{})
func (*SilentLogger) LogRotate ¶
func (*SilentLogger) LogRotate() error
func (*SilentLogger) SetLogFile ¶
func (*SilentLogger) SetLogFile(_ string) error
func (*SilentLogger) SetLogFileCount ¶
func (*SilentLogger) SetLogFileCount(_ int)
func (*SilentLogger) SetLogLevel ¶
func (*SilentLogger) SetLogLevel(_ common.LogLevel)
func (*SilentLogger) SetMaxLogSize ¶
func (*SilentLogger) SetMaxLogSize(_ int)
func (*SilentLogger) Trace ¶
func (*SilentLogger) Trace(_ string, _ ...interface{})
func (*SilentLogger) Warn ¶
func (*SilentLogger) Warn(_ string, _ ...interface{})
type SysLogger ¶
type SysLogger struct {
// contains filtered or unexported fields
}
func (*SysLogger) GetLogLevel ¶
func (*SysLogger) GetLoggerObj ¶
func (*SysLogger) SetLogFile ¶
Methods not needed for syslog based logging
func (*SysLogger) SetLogFileCount ¶
func (*SysLogger) SetLogLevel ¶
func (*SysLogger) SetMaxLogSize ¶
Click to show internal directories.
Click to hide internal directories.