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

ignore logs from Rollbar within RollbarHandler #118

Merged
merged 2 commits into from
Jul 6, 2016

Conversation

ezarowny
Copy link
Contributor

@ezarowny ezarowny commented Jul 6, 2016

Should solve an infinite loop when a connection cannot be established to rollbar.com.

@@ -68,6 +66,9 @@ def setHistoryLevel(self, level):
logging.Handler.setLevel(self, level)

def emit(self, record):
if record.name == 'rollbar':
Copy link
Member

@brianr brianr Jul 6, 2016

Choose a reason for hiding this comment

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

For good measure, how about if we also hardcode the name of the logger in rollbar/__init__.py to be the string "rollbar"? (Will make it more greppable.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That should work just fine I'd imagine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a constant for the pyrollbar log name.

@coryvirok
Copy link
Contributor

👍

@@ -68,6 +66,9 @@ def setHistoryLevel(self, level):
logging.Handler.setLevel(self, level)

def emit(self, record):
if record.name == rollbar.__log_name__:
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining why this code is here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would be wise :D

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.

3 participants