-
Notifications
You must be signed in to change notification settings - Fork 137
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
Conversation
@@ -68,6 +66,9 @@ def setHistoryLevel(self, level): | |||
logging.Handler.setLevel(self, level) | |||
|
|||
def emit(self, record): | |||
if record.name == 'rollbar': |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @coryvirok
There was a problem hiding this comment.
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.
👍 |
@@ -68,6 +66,9 @@ def setHistoryLevel(self, level): | |||
logging.Handler.setLevel(self, level) | |||
|
|||
def emit(self, record): | |||
if record.name == rollbar.__log_name__: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
98f5743
to
1d2ad27
Compare
Should solve an infinite loop when a connection cannot be established to rollbar.com.