mirror of
https://github.com/bettercap/bettercap
synced 2025-07-30 19:50:06 -07:00
refact: centralized logging into log package using Session singleton instance
This commit is contained in:
parent
23ee1223a2
commit
e36bcacf00
11 changed files with 117 additions and 72 deletions
25
log/log.go
Normal file
25
log/log.go
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue