mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-11 12:57:29 -08:00
feat(Code Node)!: Add a flag to disable forwarding of code logging to stdout (#6966)
This commit is contained in:
parent
596b5695cd
commit
0356419c1a
|
@ -2,6 +2,16 @@
|
|||
|
||||
This list shows all the versions which include breaking changes and how to upgrade.
|
||||
|
||||
## 1.5.0
|
||||
|
||||
### What changed?
|
||||
|
||||
In the Code node, `console.log` does not output to stdout by default.
|
||||
|
||||
### When is action necessary?
|
||||
|
||||
If you were relying on `console.log` for non-manual executions of a Code node, you need to set the env variable `CODE_ENABLE_STDOUT` to `true` to send Code node logs to process's stdout.
|
||||
|
||||
## 1.2.0
|
||||
|
||||
### What changed?
|
||||
|
|
|
@ -13,6 +13,8 @@ import { PythonSandbox } from './PythonSandbox';
|
|||
import { getSandboxContext } from './Sandbox';
|
||||
import { standardizeOutput } from './utils';
|
||||
|
||||
const { CODE_ENABLE_STDOUT } = process.env;
|
||||
|
||||
export class Code implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Code',
|
||||
|
@ -114,8 +116,10 @@ export class Code implements INodeType {
|
|||
'output',
|
||||
workflowMode === 'manual'
|
||||
? this.sendMessageToUI
|
||||
: (...args) =>
|
||||
console.log(`[Workflow "${this.getWorkflow().id}"][Node "${node.name}"]`, ...args),
|
||||
: CODE_ENABLE_STDOUT === 'true'
|
||||
? (...args) =>
|
||||
console.log(`[Workflow "${this.getWorkflow().id}"][Node "${node.name}"]`, ...args)
|
||||
: () => {},
|
||||
);
|
||||
return sandbox;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue