feat(Code Node)!: Add a flag to disable forwarding of code logging to stdout (#6966)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-08-25 14:23:23 +02:00
committed by GitHub
parent 596b5695cd
commit 0356419c1a
2 changed files with 16 additions and 2 deletions

View File

@@ -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;
};