Appearance
Dataport Script Reference: Logging
context.log()
Logs one or more values to the node's activity log. Objects and arrays are pretty-printed as JSON.
Signature: log(...args: any[]): void
Example:
js
context.log('Fetching data...')
context.log('Result:', { id: 1, name: 'Item' })
// Logs: "Result: {\n \"id\": 1,\n \"name\": \"Item\"\n}"context.error()
Logs one or more values to the node's activity log at error level. Objects and arrays are pretty-printed as JSON.
Signature: error(...args: any[]): void
Example:
js
try {
const result = await fetch('https://example.com/api')
return await result.json()
} catch (err) {
context.error('Request failed:', err.message)
}