From c37493b3184b7c85375d4d37ec02a32984f05f05 Mon Sep 17 00:00:00 2001 From: Dave Shawley Date: Mon, 20 Feb 2017 07:52:19 -0500 Subject: [PATCH] Add some logging around pkg_resources failures. --- sprockets_status/handlers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sprockets_status/handlers.py b/sprockets_status/handlers.py index 47107fd..d46d70f 100644 --- a/sprockets_status/handlers.py +++ b/sprockets_status/handlers.py @@ -1,9 +1,13 @@ import json +import logging import pkg_resources from tornado import web +_LOGGER = logging.getLogger(__name__) + + class StatusHandler(web.RequestHandler): """ Simple handler that returns application status information. @@ -60,7 +64,11 @@ class StatusHandler(web.RequestHandler): cls._application_name = pkg_info.project_name cls._application_version = pkg_info.version cls._package_name = None + _LOGGER.debug('found application information "%s" %s', + cls._application_name, cls._application_version) except pkg_resources.ResolutionError: + _LOGGER.exception('failed to lookup package "%r"', + cls._package_name) cls._application_name = None cls._application_version = None