Errors are now being logged to the file home-assistant.log

This commit is contained in:
Paulus Schoutsen committed 2014-01-29 18:44:39 -08:00
1 parent 2758d81525
commit 24b2fba170
3 files changed
+13 -2

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
home-assistant.log
home-assistant.conf
known_devices.csv
-2
View File
@@ -13,8 +13,6 @@ import datetime as dt
import homeassistant.util as util
logging.basicConfig(level=logging.INFO)
MATCH_ALL = '*'
DOMAIN = "homeassistant"
+12
View File
@@ -15,6 +15,18 @@ def from_config_file(config_path):
""" Starts home assistant with all possible functionality
based on a config file. """
# Setup the logging for home assistant.
logging.basicConfig(level=logging.INFO)
# Log errors to a file
err_handler = logging.FileHandler("home-assistant.log", mode='w')
err_handler.setLevel(logging.ERROR)
err_handler.setFormatter(
logging.Formatter('%(asctime)s %(name)s: %(message)s',
datefmt='%H:%M %d-%m-%y'))
logging.getLogger('').addHandler(err_handler)
# Start the actual bootstrapping
logger = logging.getLogger(__name__)
statusses = []