This commit is contained in:
@@ -2,6 +2,7 @@ package model
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
@@ -161,8 +162,9 @@ func bindBossScriptFunctions(vm *goja.Runtime, hookAction any) {
|
||||
})
|
||||
|
||||
_ = vm.Set("debug", func(call goja.FunctionCall) goja.Value {
|
||||
logCtx := context.Background()
|
||||
if len(call.Arguments) == 0 {
|
||||
g.Log().Debugf(ctx, "[boss-script] debug() called with no arguments")
|
||||
g.Log().Debugf(logCtx, "[boss-script] debug() called with no arguments")
|
||||
return goja.Undefined()
|
||||
}
|
||||
|
||||
@@ -176,7 +178,7 @@ func bindBossScriptFunctions(vm *goja.Runtime, hookAction any) {
|
||||
parts = append(parts, arg.String())
|
||||
}
|
||||
|
||||
g.Log().Debugf(ctx, "[boss-script] %s", strings.Join(parts, " "))
|
||||
g.Log().Debugf(logCtx, "[boss-script] %s", strings.Join(parts, " "))
|
||||
return goja.Undefined()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user