flow: set log to flow context
This commit is contained in:
parent
ccef1709d6
commit
8cf8711e35
|
@ -6418,7 +6418,7 @@
|
|||
"type": "function",
|
||||
"z": "9daf9e2b.019fc",
|
||||
"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,
|
||||
"noerr": 0,
|
||||
"initialize": "",
|
||||
|
@ -6495,7 +6495,7 @@
|
|||
"type": "function",
|
||||
"z": "9daf9e2b.019fc",
|
||||
"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,
|
||||
"noerr": 0,
|
||||
"initialize": "",
|
||||
|
|
Loading…
Reference in a new issue