update ILogger interface, and it's no longer compatible with log/syslog.Writer, due to performance design
This commit is contained in:
parent
5510997442
commit
c6ccf96040
29
ilogger.go
29
ilogger.go
|
@ -1,9 +1,28 @@
|
||||||
package core
|
package core
|
||||||
|
|
||||||
// logger interface, log/syslog conform with this interface
|
type LogLevel int
|
||||||
|
|
||||||
|
const (
|
||||||
|
// !nashtsai! following level also match syslog.Priority value
|
||||||
|
LOG_UNKNOWN LogLevel = iota - 2
|
||||||
|
LOG_OFF LogLevel = iota - 1
|
||||||
|
LOG_ERR LogLevel = iota + 3
|
||||||
|
LOG_WARNING
|
||||||
|
LOG_INFO LogLevel = iota + 6
|
||||||
|
LOG_DEBUG
|
||||||
|
)
|
||||||
|
|
||||||
|
// logger interface
|
||||||
type ILogger interface {
|
type ILogger interface {
|
||||||
Debug(m string) (err error)
|
Debug(v ...interface{}) (err error)
|
||||||
Err(m string) (err error)
|
Debugf(format string, v ...interface{}) (err error)
|
||||||
Info(m string) (err error)
|
Err(v ...interface{}) (err error)
|
||||||
Warning(m string) (err error)
|
Errf(format string, v ...interface{}) (err error)
|
||||||
|
Info(v ...interface{}) (err error)
|
||||||
|
Infof(format string, v ...interface{}) (err error)
|
||||||
|
Warning(v ...interface{}) (err error)
|
||||||
|
Warningf(format string, v ...interface{}) (err error)
|
||||||
|
|
||||||
|
Level() LogLevel
|
||||||
|
SetLevel(l LogLevel) (err error)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue