mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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.
|
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
|
## 1.2.0
|
||||||
|
|
||||||
### What changed?
|
### What changed?
|
||||||
|
|
|
@ -13,6 +13,8 @@ import { PythonSandbox } from './PythonSandbox';
|
||||||
import { getSandboxContext } from './Sandbox';
|
import { getSandboxContext } from './Sandbox';
|
||||||
import { standardizeOutput } from './utils';
|
import { standardizeOutput } from './utils';
|
||||||
|
|
||||||
|
const { CODE_ENABLE_STDOUT } = process.env;
|
||||||
|
|
||||||
export class Code implements INodeType {
|
export class Code implements INodeType {
|
||||||
description: INodeTypeDescription = {
|
description: INodeTypeDescription = {
|
||||||
displayName: 'Code',
|
displayName: 'Code',
|
||||||
|
@ -114,8 +116,10 @@ export class Code implements INodeType {
|
||||||
'output',
|
'output',
|
||||||
workflowMode === 'manual'
|
workflowMode === 'manual'
|
||||||
? this.sendMessageToUI
|
? this.sendMessageToUI
|
||||||
: (...args) =>
|
: CODE_ENABLE_STDOUT === 'true'
|
||||||
console.log(`[Workflow "${this.getWorkflow().id}"][Node "${node.name}"]`, ...args),
|
? (...args) =>
|
||||||
|
console.log(`[Workflow "${this.getWorkflow().id}"][Node "${node.name}"]`, ...args)
|
||||||
|
: () => {},
|
||||||
);
|
);
|
||||||
return sandbox;
|
return sandbox;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue