Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.01 KB

logging.md

File metadata and controls

38 lines (28 loc) · 1.01 KB

Logging

Maestro supports logging to the console via console.log.

{% hint style="info" %} Logging with multiple arguments is not supported. Running console.log('My variable is', variable) will only output My variable is. {% endhint %}

Logging with evalScript command

If you want to log something inline you can use evalScript to output it to the console without having to create a separate file:

- evalScript: ${console.log('Hello from Javascript')}

{% content-ref url="../../api-reference/commands/evalscript.md" %} evalscript.md {% endcontent-ref %}

Logging in a separate JavaScript file

- runScript: script.js

{% code title="script.js" %}

const myVar = 'foo';
console.log(myVar); // outputs 'foo'
console.log(`myVar is ${myVar}`) // outputs 'myVar is foo'

{% endcode %}

{% content-ref url="../../api-reference/commands/runscript.md" %} runscript.md {% endcontent-ref %}