1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/packages/node_modules/@node-red/nodes/examples/function/function/04 - Logging events.json
2020-06-24 14:43:27 +01:00

1 line
1.3 KiB
JSON

[{"id":"64470964.a291a8","type":"inject","z":"d9fbb64b.577e08","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":180,"y":120,"wires":[["ee4f5964.5cdae8"]]},{"id":"ed028c2f.924b","type":"debug","z":"d9fbb64b.577e08","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":120,"wires":[]},{"id":"b1686e70.a9f6d","type":"comment","z":"d9fbb64b.577e08","name":"logging events","info":"In body of function node code, following logging functions can be used to log events:\n- `node.log`\n- `node.warn`\n- `node.error`\n- `node.trace`\n- `node.debug`\n\nSee Node-RED user guide about [functions](https://nodered.org/docs/user-guide/writing-functions).","x":140,"y":60,"wires":[]},{"id":"ee4f5964.5cdae8","type":"function","z":"d9fbb64b.577e08","name":"log events","func":"// In function node, node.log, node.warn, and node.error functions can be used for logging\n// See debug sidebar and console output\nnode.log(\"Something happened\");\nnode.warn(\"Something happened you should know about\");\nnode.error(\"Oh no, something bad happened\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":120,"wires":[["ed028c2f.924b"]]}]