new: added new log builtin function for sync logging with prompt

This commit is contained in:
evilsocket 2018-01-11 02:00:30 +01:00
parent acbc10d4e8
commit d87bf8a3ba
4 changed files with 16 additions and 6 deletions

View file

@ -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
}