Skip to main content

debug

publishes a system 'debug' message that you can subscribe to. This is useful for debugging HiveScript functions.

debug publishes a system 'debug' message that you can subscribe to. This is useful for debugging HiveScript functions.

ContextType
Inputany set or collection
Outputthe same as the input
ParameterType
messagestring

You can provide as many 'message' parameters as you like. They will be concatenated together. The debug output contains the context too.

Examples

When a new object is detected, publish a message to the debug log:

when
object()
then
debug("here comes a new object")

Notes

You can subscribe to the debug messages.

const logSubscription = realm.instruction.subscribeToLogs()
logSubscription.on('update', data => {
// data will be the currently processed context + the log message
})
await realm.instruction.create('operations/ins1', {
instructionString: `
when object(type="scooter", charge<0.2)
then
debug("we found one").set("color", "red")
`
})