-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from samstav/v1.1.0
V1.1.0 updates
- Loading branch information
Showing
9 changed files
with
673 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
from handler import AirbrakeHandler | ||
""" | ||
airbrake-python | ||
~~~~~~~~~~~~~~~ | ||
Client for sending python exceptions to airbrake.io | ||
""" | ||
|
||
__version__ = "1.1.0" | ||
__url__ = "https://github.com/airbrake/airbrake-python" | ||
_notifier = { | ||
'name': 'airbrake-python', | ||
'version': __version__, | ||
'url': __url__ | ||
} | ||
|
||
import inspect | ||
import logging | ||
import os | ||
|
||
from airbrake import utils | ||
from airbrake.notifier import Airbrake | ||
from airbrake.handler import AirbrakeHandler | ||
|
||
logging.basicConfig() | ||
|
||
|
||
def getLogger(name=None, **kwargs): | ||
|
||
if not name: | ||
curframe = inspect.currentframe() | ||
callingpath = inspect.getouterframes(curframe, 2)[1][1] | ||
name = os.path.split( | ||
callingpath.rpartition('.')[0] or callingpath)[-1] | ||
name = "%s%s" % ('airbrake-python-', name) | ||
logger = logging.getLogger(name) | ||
ab = AirbrakeHandler(**kwargs) | ||
logger.addHandler(ab) | ||
if logger.getEffectiveLevel() == logging.NOTSET: | ||
logger.setLevel(ab.level) | ||
elif not logger.isEnabledFor(ab.level): | ||
logger.setLevel(ab.level) | ||
return logger |
Oops, something went wrong.