update ILogger interface, and it's no longer compatible with log/syslog.Writer, due to performance design

This commit is contained in:
Nash Tsai 2014-08-20 10:39:35 +08:00
parent 5510997442
commit c6ccf96040
1 changed files with 24 additions and 5 deletions

View File

@ -1,9 +1,28 @@
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 {
Debug(m string) (err error)
Err(m string) (err error)
Info(m string) (err error)
Warning(m string) (err error)
Debug(v ...interface{}) (err error)
Debugf(format string, v ...interface{}) (err error)
Err(v ...interface{}) (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)
}