Skip to content
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

Deal with callsites in Main #4219

Merged
merged 1 commit into from
Nov 5, 2021

Conversation

nathaniel-may
Copy link
Contributor

@nathaniel-may nathaniel-may commented Nov 5, 2021

Description

There were a few options to deal with the fact that many of these call sites might not have a logger set up, but I decided to go with the least interesting one: do it the same way as everywhere else. Structlog will be created using the defaults, then overriden once we have the information from the command that the user entered. If it has not been configured yet it will use the unconfigured one. The advantage here is that we will not have to change these log call sites once we refactor the cli in #4179. There is an edge case where a keyboard interrupt or an exception could occur before the default initialization of Structlog which happens on inport of the module, but I think it's acceptable to be a little splody when the whole python app hasn't even loaded yet.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change

@cla-bot cla-bot bot added the cla:yes label Nov 5, 2021
@nathaniel-may nathaniel-may changed the base branch from main to feature/structured-logging November 5, 2021 20:58
Copy link
Member

@emmyoop emmyoop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.

@nathaniel-may nathaniel-may merged commit 89e478f into feature/structured-logging Nov 5, 2021
@nathaniel-may nathaniel-may deleted the main-logging-main branch November 5, 2021 23:35
@nathaniel-may nathaniel-may mentioned this pull request Nov 8, 2021
21 tasks
iknox-fa pushed a commit that referenced this pull request Feb 8, 2022
automatic commit by git-black, original commits:
  f95e9ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants