mirror of
https://github.com/bettercap/bettercap
synced 2025-07-07 13:32:07 -07:00
new: -silent and -debug are now mapped to log.silent and log.debug that can be set at runtime (fixes #50).
This commit is contained in:
parent
09808be1a4
commit
21236c257e
3 changed files with 58 additions and 1 deletions
|
@ -272,6 +272,30 @@ func (s *Session) setupEnv() {
|
|||
s.Env.Set("iface.mac", s.Interface.HwAddress)
|
||||
s.Env.Set("gateway.address", s.Gateway.IpAddress)
|
||||
s.Env.Set("gateway.mac", s.Gateway.HwAddress)
|
||||
|
||||
dbg := "false"
|
||||
if *s.Options.Debug {
|
||||
dbg = "true"
|
||||
}
|
||||
s.Env.WithCallback("log.debug", dbg, func(newValue string) {
|
||||
newDbg := false
|
||||
if newValue == "true" {
|
||||
newDbg = true
|
||||
}
|
||||
s.Events.SetDebug(newDbg)
|
||||
})
|
||||
|
||||
silent := "false"
|
||||
if *s.Options.Silent {
|
||||
silent = "true"
|
||||
}
|
||||
s.Env.WithCallback("log.silent", silent, func(newValue string) {
|
||||
newSilent := false
|
||||
if newValue == "true" {
|
||||
newSilent = true
|
||||
}
|
||||
s.Events.SetSilent(newSilent)
|
||||
})
|
||||
}
|
||||
|
||||
func (s *Session) Start() error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue