Skip to content

Conversation

kfindeisen
Copy link
Member

@kfindeisen kfindeisen commented Mar 10, 2022

This PR cleans up the logging to make it more user-friendly.

@kfindeisen kfindeisen marked this pull request as draft March 10, 2022 20:42
def check_for_snap(
instrument: str, group: int, snap: int, detector: int
) -> Optional[str]:
prefix = f"{instrument}/{detector}/{group}/{snap}/{instrument}-{group}-{snap}-"
Copy link
Member

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.

@kfindeisen kfindeisen requested a review from parejkoj March 11, 2022 00:12
@kfindeisen kfindeisen marked this pull request as ready for review March 11, 2022 00:12
Copy link
Contributor

@parejkoj parejkoj left a 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.

@kfindeisen kfindeisen merged commit 73567eb into main Mar 11, 2022
@kfindeisen kfindeisen deleted the tickets/DM-33931 branch March 11, 2022 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants