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

chore(reports): Add logging behind feature flag #29725

Merged
merged 2 commits into from
Nov 3, 2021

Conversation

ceorourke
Copy link
Member

Add a feature flag to log some situations where a weekly report would fail to send to help diagnose a customer issue.

@ceorourke ceorourke requested a review from a team November 3, 2021 00:38
@@ -705,6 +705,14 @@ def deliver_organization_user_report(timestamp, duration, organization_id, user_
user = User.objects.get(id=user_id)

if not user_subscribed_to_organization_reports(user, organization):
if features.has("organizations:weekly-report-debugging", organization):
logger.info(
Copy link
Contributor

@mgaeta mgaeta Nov 3, 2021

Choose a reason for hiding this comment

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

If you don't mind doing something hacky I'd recommend:

log_level = "debug"
if features.has("organizations:weekly-report-debugging", organization):
    log_level = "info"

...

getattr(logger, log_level)(...)

Copy link
Member Author

Choose a reason for hiding this comment

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

Eh, I'm going to take it out in a few days anyway

@ceorourke ceorourke merged commit 1fdb6f2 into master Nov 3, 2021
@ceorourke ceorourke deleted the ceorourke/weekly-reports branch November 3, 2021 17:55
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants