Slightly nicer initialisation of Bugsnag
This commit is contained in:
@@ -176,7 +176,8 @@ class PillarServer(Eve):
|
|||||||
|
|
||||||
def _config_bugsnag(self):
|
def _config_bugsnag(self):
|
||||||
# Configure Bugsnag
|
# Configure Bugsnag
|
||||||
if self.config.get('TESTING') or not self.config.get('BUGSNAG_API_KEY'):
|
bugsnag_api_key = self.config.get('BUGSNAG_API_KEY')
|
||||||
|
if self.config.get('TESTING') or not bugsnag_api_key:
|
||||||
self.log.info('Bugsnag NOT configured.')
|
self.log.info('Bugsnag NOT configured.')
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -185,7 +186,7 @@ class PillarServer(Eve):
|
|||||||
from bugsnag.handlers import BugsnagHandler
|
from bugsnag.handlers import BugsnagHandler
|
||||||
|
|
||||||
bugsnag.configure(
|
bugsnag.configure(
|
||||||
api_key=self.config['BUGSNAG_API_KEY'],
|
api_key=bugsnag_api_key,
|
||||||
project_root="/data/git/pillar/pillar",
|
project_root="/data/git/pillar/pillar",
|
||||||
)
|
)
|
||||||
handle_exceptions(self)
|
handle_exceptions(self)
|
||||||
@@ -194,6 +195,8 @@ class PillarServer(Eve):
|
|||||||
bs_handler.setLevel(logging.ERROR)
|
bs_handler.setLevel(logging.ERROR)
|
||||||
self.log.addHandler(bs_handler)
|
self.log.addHandler(bs_handler)
|
||||||
|
|
||||||
|
self.log.info('Bugsnag setup complete')
|
||||||
|
|
||||||
def _config_google_cloud_storage(self):
|
def _config_google_cloud_storage(self):
|
||||||
# Google Cloud project
|
# Google Cloud project
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user