flow: set log to flow context

This commit is contained in:
Romain Bazile 2020-12-05 03:10:25 +01:00
parent ccef1709d6
commit 8cf8711e35

View file

@ -6418,7 +6418,7 @@
"type": "function", "type": "function",
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "Log array", "name": "Log array",
"func": "var log = context.get(\"python_log\")||[];\n\nlog = log.concat(msg.payload.trim().split('\\n'));\n\nwhile (log.length > 500){\n log.shift();\n}\n\ncontext.set(\"python_log\", log);\n\nmsg.payload = log;\nreturn msg;", "func": "var log = flow.get(\"python_log\")||[];\n\nlog = log.concat(msg.payload.trim().split('\\n'));\n\nwhile (log.length > 500){\n log.shift();\n}\n\nflow.set(\"python_log\", log);\n\nmsg.payload = log;\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",
@ -6495,7 +6495,7 @@
"type": "function", "type": "function",
"z": "9daf9e2b.019fc", "z": "9daf9e2b.019fc",
"name": "Clear log", "name": "Clear log",
"func": "context.set(\"python_log\", []);\n\nmsg.payload = [];\nreturn msg;", "func": "flow.set(\"python_log\", []);\n\nmsg.payload = [];\nreturn msg;",
"outputs": 1, "outputs": 1,
"noerr": 0, "noerr": 0,
"initialize": "", "initialize": "",