-
Notifications
You must be signed in to change notification settings - Fork 0
DM-33931: Improve logging #9
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
6650f42
to
bb2c0b8
Compare
def check_for_snap( | ||
instrument: str, group: int, snap: int, detector: int | ||
) -> Optional[str]: | ||
prefix = f"{instrument}/{detector}/{group}/{snap}/{instrument}-{group}-{snap}-" |
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.
Do you want to make use of the MDC feature that we use in butler logging? That lets you set an MDC record and after that every log message will get that content included without you having to explicitly add "prefix" to every log message.
bb2c0b8
to
6cf994e
Compare
3907bab
to
c09b60b
Compare
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.
Thanks for this. One comment about how we name the loggers (and possibly one comment that I can't see any more about f-strings).
Thanks for leaving the f-strings: let's see where the discussion on that ends up before we convert them all.
c09b60b
to
e3e2106
Compare
This PR cleans up the logging to make it more user-friendly.