mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 13:02:12 -07:00
new: added new log builtin function for sync logging with prompt
This commit is contained in:
parent
acbc10d4e8
commit
d87bf8a3ba
4 changed files with 16 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
|||
package modules
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/evilsocket/bettercap-ng/log"
|
||||
|
@ -26,5 +27,15 @@ func (s *ProxyScript) defineBuiltins() error {
|
|||
return v
|
||||
})
|
||||
|
||||
s.VM.Set("log", func(call otto.FunctionCall) otto.Value {
|
||||
for _, v := range call.ArgumentList {
|
||||
fmt.Printf("%s", v.String())
|
||||
}
|
||||
fmt.Println()
|
||||
s.sess.Input.Refresh()
|
||||
|
||||
return otto.Value{}
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue