Documentation ¶
Index ¶
- Variables
- type Auditor
- type CallerHook
- type ScdoLog
- func (p *ScdoLog) Debug(format string, args ...interface{})
- func (p *ScdoLog) Error(format string, args ...interface{})
- func (p *ScdoLog) Fatal(format string, args ...interface{})
- func (p *ScdoLog) GetLevel() logrus.Level
- func (p *ScdoLog) Info(format string, args ...interface{})
- func (p *ScdoLog) Panic(format string, args ...interface{})
- func (p *ScdoLog) SetLevel(level logrus.Level)
- func (p *ScdoLog) Warn(format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
var ( // LogFolder the default folder to write logs LogFolder = filepath.Join(common.GetTempFolder(), "log") )
Functions ¶
This section is empty.
Types ¶
type Auditor ¶
type Auditor struct {
// contains filtered or unexported fields
}
Auditor is used for auditing step by step via log.
func NewAuditor ¶
NewAuditor returns a new auditor instance with specified log and an optional last time.
func (*Auditor) AuditEnter ¶
AuditEnter adds log for method enter.
type CallerHook ¶
type CallerHook struct {
// contains filtered or unexported fields
}
CallerHook a caller hook of logrus
func (*CallerHook) Fire ¶
func (hook *CallerHook) Fire(entry *logrus.Entry) error
Fire adds a caller field in logger instance
func (*CallerHook) Levels ¶
func (hook *CallerHook) Levels() []logrus.Level
Levels returns supported levels
type ScdoLog ¶
type ScdoLog struct {
// contains filtered or unexported fields
}
ScdoLog wraps log class
func GetLogger ¶
GetLogger gets logrus.Logger object according to module name each module can have its own logger
func (*ScdoLog) Error ¶
Error Level. Error logs and is used for errors that should be definitely noted. Commonly used for hooks to send errors to an error tracking service.
func (*ScdoLog) Fatal ¶
Fatal Level. Fatal logs and then calls `os.Exit(1)`. It will exit even if the logging level is set to Panic.
func (*ScdoLog) Info ¶
Info Level. General operational entries about what's going on inside the application.
func (*ScdoLog) Panic ¶
Panic Level, highest level of severity. Panic logs and then calls panic with the message passed to Debug, Info, ...