mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
✨ Enable multiple args in logging via nodes (#2501)
* ⚡ Enable multiple args in logging via nodes * 👕 Fix lint * ⚡ Change to behave more as expected Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
parent
c0b519a149
commit
c50b6c2c21
|
@ -924,7 +924,7 @@ export async function executeWorkflow(
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
export function sendMessageToUI(source: string, message: any) {
|
export function sendMessageToUI(source: string, messages: any[]) {
|
||||||
if (this.sessionId === undefined) {
|
if (this.sessionId === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -936,7 +936,7 @@ export function sendMessageToUI(source: string, message: any) {
|
||||||
'sendConsoleMessage',
|
'sendConsoleMessage',
|
||||||
{
|
{
|
||||||
source: `Node: "${source}"`,
|
source: `Node: "${source}"`,
|
||||||
message,
|
messages,
|
||||||
},
|
},
|
||||||
this.sessionId,
|
this.sessionId,
|
||||||
);
|
);
|
||||||
|
|
|
@ -1649,13 +1649,13 @@ export function getExecuteFunctions(
|
||||||
async putExecutionToWait(waitTill: Date): Promise<void> {
|
async putExecutionToWait(waitTill: Date): Promise<void> {
|
||||||
runExecutionData.waitTill = waitTill;
|
runExecutionData.waitTill = waitTill;
|
||||||
},
|
},
|
||||||
sendMessageToUI(message: any): void {
|
sendMessageToUI(...args: any[]): void {
|
||||||
if (mode !== 'manual') {
|
if (mode !== 'manual') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (additionalData.sendMessageToUI) {
|
if (additionalData.sendMessageToUI) {
|
||||||
additionalData.sendMessageToUI(node.name, message);
|
additionalData.sendMessageToUI(node.name, args);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||||
|
|
|
@ -461,7 +461,7 @@ export interface IPushDataTestWebhook {
|
||||||
|
|
||||||
export interface IPushDataConsoleMessage {
|
export interface IPushDataConsoleMessage {
|
||||||
source: string;
|
source: string;
|
||||||
message: string;
|
messages: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IVersionNotificationSettings {
|
export interface IVersionNotificationSettings {
|
||||||
|
|
|
@ -165,7 +165,7 @@ export const pushConnection = mixins(
|
||||||
|
|
||||||
if (receivedData.type === 'sendConsoleMessage') {
|
if (receivedData.type === 'sendConsoleMessage') {
|
||||||
const pushData = receivedData.data;
|
const pushData = receivedData.data;
|
||||||
console.log(pushData.source, pushData.message); // eslint-disable-line no-console
|
console.log(pushData.source, ...pushData.messages); // eslint-disable-line no-console
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue