sentry.tasks.cleanup should use logging instead of print #640

23doors opened this Issue Oct 31, 2012 · 0 comments


None yet
2 participants

23doors commented Oct 31, 2012

In distributed environments, adding sentry cleanup to cron is not a good enough choice anymore.

That's why it was better for us to run it inside celery task. All is peachy, but this task is printing a lot of crap to stdout while it should use logging instead. Like:

WARNING 2012-10-31 17:49:09,962 celery.redirected[]: checking filters

Preferably allow logger parameter to it.

def cleanup(days=30, logger=None, site=None, server=None, level=None,
project=None, resolved=None, logger=None, **kwargs):
print_info = if logger else sys.stdout.write

And in code, use print_info instead of print.

@dcramer dcramer closed this in 3b29ec2 Nov 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment