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

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

Closed
23doors opened this issue Oct 31, 2012 · 0 comments
Closed

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

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

Comments

@23doors
Copy link

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[log.py:238]: checking filters

Preferably allow logger parameter to it.

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

And in code, use print_info instead of print.

@dcramer dcramer closed this as completed in 3b29ec2 Nov 1, 2012
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants