-
Notifications
You must be signed in to change notification settings - Fork 154
improv(logger): streamline Logger types #3054
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
Conversation
I'll start reviewing it tomorrow morning and this will take longer to complete. If @am29d approves it before then, please go ahead and merge. |
No rush - thank you! |
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 @dreamorosi! I made some small changes to the text/docstring to make it clearer for users. In this PR I didn't look too much at TypeScript code itself and things you renamed or moved from here to there, because that seems fine and you have much more context.
I tested this code locally and saw that the IDE hints are working as expected.
I'll ask for a Request Changes so you can check if the changes make sense.
Co-authored-by: Leandro Damascena <[email protected]>
|
Summary
Changes
I started working on this PR to improve the work merged in #2736 and provide a better DX for customers using the feature.
The main goal was to have TypeScript suggest the possible values for log keys as well as accept arbitrary strings.
While working on this improvement, which I achieved (see screenshot below), I quickly realized that the types for the Logger had become convoluted.
Most of the types were not documented, and especially the types around log keys and contents of a log had become confused.
In this PR I have refactored, reorganized, and documented all the types for the Logger class - as well as some methods - to ensure that each one of them provides useful info for customers and maintainers alike.
The internal logic of the Logger remains unchanged, however due to having added many new comment blocks, the diff seems abnormally larger than it really is.
Issue number: closes #3053
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.