I'm trying to use the Airbrake logger in a Django project following the steps described in https://github.com/airbrake/pybrake#django-integration.
I've configured my LOGGING
setting like so:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'airbrake': {
'level': 'ERROR',
'class': 'pybrake.LoggingHandler',
}
},
'loggers': {
'lucy_web': {
'handlers': ['airbrake'],
'level': 'ERROR',
'propagate': True,
}
}
}
Then, in a particular file in the lucy_web
hierarchy called lucy_web/lib/session_recommendation.py
, I have the following test function:
import logging
logger = logging.getLogger(__name__)
def log_something():
logger.error("Logging something...")
However, if I try to call this function from the Django shell, pybrake
itself logs an error:
strconv.ParseInt: parsing "None": invalid syntax
Here is the full sequence of commands:
(venv) Kurts-MacBook-Pro-2:lucy-web kurtpeek$ python manage.py shell
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.3.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from lucy_web.lib.session_recommendation import *
In [2]: log_something()
In [3]: 2018-05-30 17:25:32,201 - pybrake - ERROR - strconv.ParseInt: parsing "None": invalid syntax
It would appear from https://golang.org/pkg/strconv/#ParseInt that strconv.ParseInt
is actually a built-in function of the Go language, so I don't understand why pybrake
, which is a Python package, is throwing this error, or how to debug it. Can anyone explain this error?