Add experimental support for decoupling tracer error and debug logs#718
Closed
ericmustin wants to merge 1 commit intoDataDog:masterfrom
Closed
Add experimental support for decoupling tracer error and debug logs#718ericmustin wants to merge 1 commit intoDataDog:masterfrom
ericmustin wants to merge 1 commit intoDataDog:masterfrom
Conversation
Member
|
Thanks for the PR! The idea makes sense in general, but I'd prefer to make it more flexible as we plan to add new log levels in the future. Maybe we could add a What do you think? |
Contributor
Author
|
@rochdev thanks for taking a look. Yup i think that's a better approach and allows for more flexibility going forward. I can work on putting that together, will close this branch and push up a new one when I have something ready for review |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR addresses the use case introduced in Issue 599 for when a user wants to forward tracer errors to their logger but ignore debug messages. Currently the logger requires
debuganderrorkeys for theloggerobject and will always compute the debug message even if a custom logger is passed withdebugset to anoopfunction. This PR adds experimental support for anonlyErrorsconfiguration option which disables the debug message computation and output, if both the tracer's logger is enabled andexperimental.onlyErrorsis set totrueMotivation
It has been hanging around in the Open Issues for awhile and it bothered me that the logging wasn't as flexible as it ought to be. I wanted to avoid changing the format of user's existing custom loggers, so adding this via the
experimentaloptions felt like a low friction way to help resolve the issue for users going forward while maintaining backward compatibility for existing implementations.Additional Notes
Thanks for taking a look! Let me know what y'all think or if it's worth the hassle of adding, happy to address any feedback. Not terribly familiar with Typescript and a bit rusty with Node in general, so apologies if I've missed something here. That being said, seems to help a few users out there who want to reduce the noise in their logs while still forwarding relevant tracer errors, and seemed like low hanging fruit, so figured I'd give it a shot.