-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat(logger): introduce loglevel trace #1589 #2902
feat(logger): introduce loglevel trace #1589 #2902
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
I performed some refactorings of the exisiting code in the last two commits. Let me know if I should move them into a seperate PR. |
Hi @timo92, thanks for the quick PR. Looking at the test results it seems that we have two issues:
The first one is quite interesting, and I think it will require a bit more time on this PR. Before getting into its details, a bit of context is needed. By default, Logger does not use the global According to the Node.js docs:
Even though this is not explicitly called out in the docs, the global My first idea was to suggest we patch the This however requires some extra consideration because in Node.js the console.trace('Show me');
// Prints: (stack trace will vary based on where trace is called)
// Trace: Show me
// at repl:2:9
// at REPLServer.defaultEval (repl.js:248:27)
// at bound (domain.js:287:14)
// at REPLServer.runBound [as eval] (domain.js:300:12)
// at REPLServer.<anonymous> (repl.js:412:12)
// at emitOne (events.js:82:20)
// at REPLServer.emit (events.js:169:7)
// at REPLServer.Interface._onLine (readline.js:210:10)
// at REPLServer.Interface._line (readline.js:549:8)
// at REPLServer.Interface._ttyWrite (readline.js:826:14) This is clearly not what we want, however it means we will need to also modify the logging behavior when -- Side note 1: If you want a faster feedback loop, you can setup the local dev environment, by running Side note 2: The scope of this task unexpectedly grew beyond what was going to be a simple change. We are more than happy to work with you and iterate on the PR, however if you feel like it's not what you thought and want to close the PR we completely understand and will put the issue back in the backlog. |
Change log level to debug only if current log level is higher
Hey @dreamorosi, thank you for the infos and links. I have adjusted the PR to patch console with a trace method which simply forwards the arguments to console.log which should exist on any console implementation. I would defer adding the documentation until we have decided that this is an appropriate workaround. Regarding local development: |
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.
Hi @timo92, apologies for the delayed review.
I have left a couple of minor comments and a suggestion. After they are addressed I think we can merge this right away.
Quality Gate passedIssues Measures |
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.
Thank you for working on this and for iterating on the PR with us. Appreciate it!
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Summary
Changes
This PR introduces a new log level
TRACE
below 'DEBUG' in alignment with the AWS Lambda ALC.Issue number: closes #1589
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.