mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
new: centralized logging and implemented DELETE /api/events route, closes #5
This commit is contained in:
parent
269d7d845b
commit
f1f146d3d7
21 changed files with 144 additions and 184 deletions
|
@ -70,7 +70,7 @@ func (d *Discovery) Start() error {
|
|||
d.SetRunning(true)
|
||||
|
||||
go func() {
|
||||
log.Info("Network discovery started.\n")
|
||||
d.Session.Events.Log(session.INFO, "Network discovery started.")
|
||||
|
||||
for {
|
||||
select {
|
||||
|
@ -78,7 +78,7 @@ func (d *Discovery) Start() error {
|
|||
var err error
|
||||
|
||||
if d.current, err = net.ArpUpdate(d.Session.Interface.Name()); err != nil {
|
||||
log.Error(err)
|
||||
d.Session.Events.Log(session.ERROR, "%s", err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ func (d *Discovery) Start() error {
|
|||
b = ""
|
||||
}
|
||||
|
||||
log.Warningf("WARNING: Found %d endpoint%s which share%s the same MAC of the gateway (%s), there're might be some IP isolation going on, skipping.\n", n_gw_shared, a, b, d.Session.Gateway.HwAddress)
|
||||
d.Session.Events.Log(session.WARNING, "WARNING: Found %d endpoint%s which share%s the same MAC of the gateway (%s), there're might be some IP isolation going on, skipping.", n_gw_shared, a, b, d.Session.Gateway.HwAddress)
|
||||
}
|
||||
|
||||
// refresh target pool
|
||||
|
@ -127,7 +127,7 @@ func (d *Discovery) Start() error {
|
|||
d.before = d.current
|
||||
|
||||
case <-d.quit:
|
||||
log.Info("Network discovery stopped.\n")
|
||||
d.Session.Events.Log(session.INFO, "Network discovery stopped.")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue