Documentation ¶
Index ¶
- Constants
- func Close()
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func GetLogDirectory() string
- func Logf(format string, args ...interface{})
- func Printf(format string, args ...interface{})
- func Request(tag string, request interface{}, err error)
- func Response(tag string, response interface{}, returnCode int, returnStr string, err error)
- func SetLevel(level int)
- func SetLogDirectory(logDirectory string)
- func SetLogFileLimits(maxFileSize int, maxFileCount int)
- func SetName(name string)
- func SetTarget(target int) error
- type Logger
- func (logger *Logger) Close()
- func (logger *Logger) Debugf(format string, args ...interface{})
- func (logger *Logger) Errorf(format string, args ...interface{})
- func (logger *Logger) GetLogDirectory() string
- func (logger *Logger) Logf(format string, args ...interface{})
- func (logger *Logger) Printf(format string, args ...interface{})
- func (logger *Logger) Request(tag string, request interface{}, err error)
- func (logger *Logger) Response(tag string, response interface{}, returnCode int, returnStr string, err error)
- func (logger *Logger) SetChannel(reports chan interface{})
- func (logger *Logger) SetLevel(level int)
- func (logger *Logger) SetLogDirectory(logDirectory string)
- func (logger *Logger) SetLogFileLimits(maxFileSize int, maxFileCount int)
- func (logger *Logger) SetName(name string)
- func (logger *Logger) SetTarget(target int) error
Constants ¶
View Source
const ( LevelAlert = iota LevelError LevelWarning LevelInfo LevelDebug )
Log level
View Source
const ( TargetStderr = iota TargetSyslog TargetLogfile TargetStdout TargetStdOutAndLogFile )
Log target
View Source
const (
// LogPath is the path where log files are stored.
LogPath = "/var/log/"
)
Variables ¶
This section is empty.
Functions ¶
func GetLogDirectory ¶ added in v1.0.4
func GetLogDirectory() string
func Logf ¶ added in v1.0.23
func Logf(format string, args ...interface{})
Logf logs to the local log.
func Printf ¶
func Printf(format string, args ...interface{})
Printf logs to the local log and send the log through the channel.
func SetLogDirectory ¶ added in v1.0.4
func SetLogDirectory(logDirectory string)
func SetLogFileLimits ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger object
func (*Logger) Errorf ¶ added in v1.0.16
Errorf logs a formatted string at info level and sends the string to TelemetryBuffer.
func (*Logger) GetLogDirectory ¶ added in v1.0.4
GetLogDirectory gets the directory location where logs should be stored.
func (*Logger) Response ¶
func (logger *Logger) Response(tag string, response interface{}, returnCode int, returnStr string, err error)
Response logs a structured response.
func (*Logger) SetChannel ¶ added in v1.0.16
func (logger *Logger) SetChannel(reports chan interface{})
SetChannel sets the channel for error message reports.
func (*Logger) SetLogDirectory ¶ added in v1.0.4
SetLogDirectory sets the directory location where logs should be stored.
func (*Logger) SetLogFileLimits ¶
SetLogFileLimits sets the log file limits.
Click to show internal directories.
Click to hide internal directories.