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.
This isn't quite a no-op. The local
logtwo lines up isstructlog.get_logger(logger_name="task"), but the class default isfactory=structlog.get_logger, which builds an unnamed logger.CommsDecoder.logis used in_from_frameforself.log.exception("Unable to decode message"), so after this change that decode-error log loses itslogger=taskbinding (thelogger_nameprocessor readslogger_nameoff the bound context). It's a minor, error-path-only regression, but it does mean the cleanup changes behavior rather than just dropping a redundant arg.Worth noting #44615 asked to give the class a
logattribute with a default so callers don't have to pass one, and that already landed in #51699. Heremain()does have a meaningful named logger on hand, andcallback_supervisor.pystill passeslog=get_logger(logger_name="callback_runner")for the same reason. Keepinglog=logat this site preserves thetaskname and matches that pattern.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.
Yes I also confused for this - now got it ! Thanks @kaxil !
I have checked on my side that the issue requirements are satisfied
Would you like me to give any other tasks to do in this or I'll close this PR and will close this
issue as completedWould love to hear your thoughts @uranusjr !
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 can be
functools.partial(structlog.get_logger, "logger name")here (with the logger name being the CommsDecoder’s import path)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 yes let’s keep the explicit log parameters.