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 Apr 3, 2018
@davidfischer
Copy link
Contributor

@davidfischer davidfischer commented Apr 3, 2018

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

Loading

@humitos
Copy link
Member Author

@humitos 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.

Loading

@@ -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

@stsewd stsewd Apr 4, 2018

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? 🙏

Loading

Copy link
Member Author

@humitos humitos Apr 4, 2018

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

Loading

# 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

@davidfischer davidfischer Apr 4, 2018

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.

Loading

Copy link
Member Author

@humitos humitos Apr 5, 2018

Choose a reason for hiding this comment

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

You are right. Changing.

Loading

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

@agjohnson agjohnson left a comment

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.

Loading

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

@humitos 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.

Loading

@humitos humitos deleted the humitos/log/sentry branch May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants