Documentation
¶
Index ¶
- Variables
- type Log
- func (*Log) Alert(a ...interface{})
- func (l *Log) AlertOnErr(fn func() error, a ...interface{})
- func (*Log) Alertf(format string, a ...interface{})
- func (l *Log) AlertfOnErr(fn func() error, format string, a ...interface{})
- func (*Log) Crit(a ...interface{})
- func (l *Log) CritOnErr(fn func() error, a ...interface{})
- func (*Log) Critf(format string, a ...interface{})
- func (l *Log) CritfOnErr(fn func() error, format string, a ...interface{})
- func (l *Log) Debug(a ...interface{})
- func (l *Log) Debugf(format string, a ...interface{})
- func (*Log) Emerg(a ...interface{})
- func (l *Log) EmergOnErr(fn func() error, a ...interface{})
- func (*Log) Emergf(format string, a ...interface{})
- func (l *Log) EmergfOnErr(fn func() error, format string, a ...interface{})
- func (*Log) Err(a ...interface{})
- func (l *Log) ErrOnErr(fn func() error, a ...interface{})
- func (*Log) Errf(format string, a ...interface{})
- func (l *Log) ErrfOnErr(fn func() error, format string, a ...interface{})
- func (*Log) Info(a ...interface{})
- func (*Log) Infof(format string, a ...interface{})
- func (*Log) Notice(a ...interface{})
- func (*Log) Noticef(format string, a ...interface{})
- func (l *Log) Trace(msg string) func()
- func (*Log) Warn(a ...interface{})
- func (l *Log) WarnOnErr(fn func() error, a ...interface{})
- func (*Log) Warnf(format string, a ...interface{})
- func (l *Log) WarnfOnErr(fn func() error, format string, a ...interface{})
Constants ¶
This section is empty.
Variables ¶
var DebugPtr *log.Logger
var TracePtr *log.Logger
Functions ¶
This section is empty.
Types ¶
type Log ¶
type Log struct{}
func NewFileLogger ¶
NewFileLogger func - creating new file logger.
Fields:
LogFile - path to log file LogLevel - log level, possible levels: 0 - Emergency, with panic exit. 1 - Alert, with exit 2. 2 - Critical, with ext 1. 3 - Errors. 4 - Warnings. 5 - Notice. 6 - Info. 7 - Debug. 8 - Trace.
Example, for reusing current pointer to this logger, just define in package var log *logger.Log: var log *logger.Log // Using log subsystem
func init() {
// Initialization log system
var err error
if log, err = logger.NewFileLogger(environment.GetLogFile(), environment.GetLogLevel()); err != nil {
panic(err)
}
}
func (*Log) Alert ¶
func (*Log) Alert(a ...interface{})
Alert logging a message using Alert (1) as log level and call os.Exit(1).
func (*Log) AlertOnErr ¶ added in v1.0.2
func (*Log) AlertfOnErr ¶ added in v1.0.2
func (*Log) Crit ¶
func (*Log) Crit(a ...interface{})
Crit logging a message using Crit (2) as log level and call os.Exit(1).
func (*Log) CritfOnErr ¶ added in v1.0.2
func (*Log) Debug ¶
func (l *Log) Debug(a ...interface{})
Debug logging a message using DEBUG as log level.
func (*Log) Emerg ¶
func (*Log) Emerg(a ...interface{})
Emerg logging a message using Emerg (0) as log level and call panic(fmt string).
func (*Log) EmergOnErr ¶ added in v1.0.2
func (*Log) Emergf ¶
Emergf logging a message using Emerg (0) as log level and call panic(fmt string).
func (*Log) EmergfOnErr ¶ added in v1.0.2
func (*Log) Err ¶
func (*Log) Err(a ...interface{})
Err logging a message using Error (3) as log level.
func (*Log) Info ¶
func (*Log) Info(a ...interface{})
Info logging a message using Info (6) as log level.
func (*Log) Notice ¶
func (*Log) Notice(a ...interface{})
Notice logging a message using Notice (5) as log level.
func (*Log) Warn ¶
func (*Log) Warn(a ...interface{})
Warn logging a message using Warn (4) as log level.