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

Organize logging levels #3893

Merged
merged 3 commits into from
Apr 5, 2018
Merged

Organize logging levels #3893

merged 3 commits into from
Apr 5, 2018

Conversation

humitos
Copy link
Member

@humitos humitos commented Apr 3, 2018

Log only what we need as ERROR when it's something that we need/want to take a look that something could be a bug/issue.

There are some ERROR that were replaced by WARNING since they are some failures but that we don't need to take a look and the message shown to the user should be enough for them.

Check #3898 for style changes

Log only what we need as ERROR when it's something that we need/want
to take a look that something could be a bug/issue.

There are some ERROR that were replaced by WARNING since they are some
failures but that we don't need to take a look and the message shown
to the user should be enough for them.
@davidfischer davidfischer self-assigned this Apr 3, 2018
@davidfischer davidfischer self-requested a review April 3, 2018 15:35
@davidfischer
Copy link
Contributor

I'll take this one on however the CI issues look real.

@humitos
Copy link
Member Author

humitos commented Apr 4, 2018

@davidfischer I didn't understand your comment and why you assigned this PR to you :P , but I just fixed the linting issues reported by travis.

@@ -58,8 +58,7 @@ def copy(cls, path, target, is_file=False, **__):
mkdir_cmd = ("ssh %s@%s mkdir -p %s" % (sync_user, server, target))
ret = os.system(mkdir_cmd)
if ret != 0:
log.info("COPY ERROR to app servers:")
log.info(mkdir_cmd)
log.error("Copy error to app servers: cmd=%s", mkdir_cmd)
Copy link
Member

Choose a reason for hiding this comment

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

Can we start using single quotes ' around all the strings? 🙏

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't do this manually. We are trying to use pre-commit more often that does this automatically.

The result of pre-commit ran under all the modified files by this PR is at: #3898

# Catch unhandled errors when syncing
except RepositoryError as e:
# Do not log as ERROR handled exceptions
log.warning('There was an error with the repository: msg=%s', e.msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

We could pass exc_info=True to log.warning if you want the full exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right. Changing.

@davidfischer davidfischer removed their assignment Apr 4, 2018
@humitos humitos requested a review from agjohnson April 5, 2018 22:04
Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I don't think this is going to reduce our sentry usage enough. I'm leaving #3856 open for now.

@agjohnson agjohnson merged commit 5cb3ba6 into master Apr 5, 2018
@humitos
Copy link
Member Author

humitos commented Apr 6, 2018

In theory after this PR get deployed, we should be seeing only errors that we should take a look and do not ignore in Sentry.

There could be a little more tweak to do maybe, but the general problem should be fixed.

@humitos humitos deleted the humitos/log/sentry branch May 30, 2018 21:21
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.

4 participants