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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions rollbar/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
logger.addHandler(rollbar_handler)

"""
import copy
import logging
import threading
import time

import rollbar

Expand Down Expand Up @@ -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.

return

level = record.levelname.lower()

if level not in self.SUPPORTED_LEVELS:
Expand Down