generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 24
Add logging for input and output event streams #408
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
Merged
jonathan343
merged 5 commits into
smithy-lang:develop
from
jonathan343:event-stream-logging
Mar 19, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e68f4b3
Add logging for input and output event streams
jonathan343 78d1ac7
Update logger messages
jonathan343 a4a3c50
Make logger a constant by uppercasing it
jonathan343 94a5fc7
Remove extra line added during rebase
jonathan343 71dac66
Revert "Make logger a constant by uppercasing it"
jonathan343 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
It seems wrong to make this variable all-caps since it doesn't represent a constant and instead represents a
<class 'logging.Logger'>object. Also, for what it's worth,loggerseems to be the standard in docs and other projects I've seen.I don't feel too strongly, so happy to change if you disagree.
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.
But it is a constant. You're never mutating it in any scope.
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 could more accurately describe it as
Final, which is more or less the same concept.Finalsymbols in Python are generally upper-cased. In fact, upper casing a symbol name implicitly finalizes it. SoLOGGERis equivalent toLOGGER: Final.PEP8 doesn't really have anything to say about
Final, but that was written 20 years beforeFinalwas an actual construct in the language. But most programming language naming conventions upper-case finalized properties and constantsThere 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.
Yea I totally agree with you now. I've updated this in 74881a1
Also, I had no idea this was a thing. Pretty cool
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 can add the typing, I don't know if we need to all caps it as a constant.
loggeris pretty much the universal standard for implementing your file-scope logger. It's in the docs and we already use it that way in other files. It's also convention in other languages like Java (ref) where constant is considered some immutable value.If we really feel strongly about it, lets split that work into a separate PR to update everything at once rather than having the logger name be inconsistent across libraries.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sure, I reverted the change for now and will follow up with a separate PR to address all instances if we decide to switch to
LOGGER