refact: centralized logging into log package using Session singleton instance

This commit is contained in:
evilsocket 2018-01-08 12:25:26 +01:00
parent 23ee1223a2
commit e36bcacf00
11 changed files with 117 additions and 72 deletions

25
log/log.go Normal file
View file

@ -0,0 +1,25 @@
package log
import (
"github.com/evilsocket/bettercap-ng/session"
)
func Debug(format string, args ...interface{}) {
session.I.Events.Log(session.DEBUG, format, args)
}
func Info(format string, args ...interface{}) {
session.I.Events.Log(session.INFO, format, args)
}
func Warning(format string, args ...interface{}) {
session.I.Events.Log(session.WARNING, format, args)
}
func Error(format string, args ...interface{}) {
session.I.Events.Log(session.ERROR, format, args)
}
func Fatal(format string, args ...interface{}) {
session.I.Events.Log(session.FATAL, format, args)
}