mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -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
|
||||
export function sendMessageToUI(source: string, message: any) {
|
||||
export function sendMessageToUI(source: string, messages: any[]) {
|
||||
if (this.sessionId === undefined) {
|
||||
return;
|
||||
}
|
||||
|
@ -936,7 +936,7 @@ export function sendMessageToUI(source: string, message: any) {
|
|||
'sendConsoleMessage',
|
||||
{
|
||||
source: `Node: "${source}"`,
|
||||
message,
|
||||
messages,
|
||||
},
|
||||
this.sessionId,
|
||||
);
|
||||
|
|
|
@ -1649,13 +1649,13 @@ export function getExecuteFunctions(
|
|||
async putExecutionToWait(waitTill: Date): Promise<void> {
|
||||
runExecutionData.waitTill = waitTill;
|
||||
},
|
||||
sendMessageToUI(message: any): void {
|
||||
sendMessageToUI(...args: any[]): void {
|
||||
if (mode !== 'manual') {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (additionalData.sendMessageToUI) {
|
||||
additionalData.sendMessageToUI(node.name, message);
|
||||
additionalData.sendMessageToUI(node.name, args);
|
||||
}
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
||||
|
|
|
@ -461,7 +461,7 @@ export interface IPushDataTestWebhook {
|
|||
|
||||
export interface IPushDataConsoleMessage {
|
||||
source: string;
|
||||
message: string;
|
||||
messages: string[];
|
||||
}
|
||||
|
||||
export interface IVersionNotificationSettings {
|
||||
|
|
|
@ -165,7 +165,7 @@ export const pushConnection = mixins(
|
|||
|
||||
if (receivedData.type === 'sendConsoleMessage') {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue