-
Notifications
You must be signed in to change notification settings - Fork 51.2k
feat: Add node debug logging #22527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Add node debug logging #22527
Conversation
BundleMonUnchanged files (2)
No change in files bundle size Groups updated (2)
Final result: ✅ View report in BundleMon website ➡️ |
❌ 39 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
|
E2E Tests: n8n tests passed after 10m 20.6s Run Details
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
|
Found 41 test failures on Blacksmith runners: Failures
|
| function copyRequestOptionsForLogs( | ||
| ctx: IAllExecuteFunctions, | ||
| requestOptions: IHttpRequestOptions, | ||
| ): IHttpRequestOptions | null; | ||
| function copyRequestOptionsForLogs( | ||
| ctx: IAllExecuteFunctions, | ||
| requestOptions: IRequestOptions, | ||
| ): IRequestOptions | null; | ||
| function copyRequestOptionsForLogs( | ||
| ctx: IAllExecuteFunctions, | ||
| requestOptions: IRequestOptions | IHttpRequestOptions, | ||
| ): IRequestOptions | IHttpRequestOptions | null { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better with generics?
| secrets = getSecrets(properties, credentials); | ||
| } | ||
| const sanitizedRequestOptions = sanitizeUiMessage(requestOptions, authKeys, secrets); | ||
| ctx.sendMessageToUI(sanitizedRequestOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use a new nodeDebugLogger as it would also use logger
e.g. ctx.nodeDebugLogger(sanitizedRequestOptions, 'Request Options');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we format JSON, each request takes a lot of space in logs and I had some security concerns, so I just sent it to UI
| // TODO: change to nodeDebugLogger and log request to server logs? | ||
| const ctxCompatible = 'sendMessageToUI' in ctx; | ||
| const canLog = node.nodeDebugLogs && ctx.getMode?.() === 'manual' && requestOptions !== null; | ||
| if (ctxCompatible && canLog) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably need to do this check once and have in context
|
|
||
| getExecutionContext: () => IExecutionContext | undefined; | ||
|
|
||
| nodeDebugLogger(message: any, tag?: string): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to have nodeLogger with methods log(), debug(), warn(), error()
Summary
This is a Node team hack week project to improve debug logging for nodes.
Related Linear tickets, Github issues, and Community forum posts
s #", or "resolves #" to automatically close issues when the PR is merged. -->
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)