More clear logs when dependencies are missing.

pull/2/head
Paulus Schoutsen 2013-10-24 00:32:23 +01:00
parent 00c9d22a58
commit b43e413de9
2 changed files with 5 additions and 6 deletions

View File

@ -191,8 +191,8 @@ class HueLightControl(object):
try:
import phue
except ImportError:
logging.getLogger(__name__).error(("HueLightControl:"
"Unable to init due to missing dependency phue."))
logging.getLogger(__name__).exception(("HueLightControl:"
"Error while importing dependency phue."))
self.success_init = False
@ -341,8 +341,8 @@ def setup_media_buttons(eventbus):
try:
import pykeyboard
except ImportError:
logging.getLogger(__name__).error(("MediaButtons:"
"Unable to setup due to missing dependency PyUserInput."))
logging.getLogger(__name__).exception(("MediaButtons:"
"Error while importing dependency PyUserInput."))
return False

View File

@ -50,8 +50,7 @@ def track_sun(eventbus, statemachine, latitude, longitude):
try:
import ephem
except ImportError:
logger.error(("TrackSun:"
"Unable to setup due to missing dependency ephem."))
logger.exception(("TrackSun:Error while importing dependency ephem."))
return False
sun = ephem.Sun() # pylint: disable=no-member