mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Errors are now being logged to the file home-assistant.log
This commit is contained in:
parent
2758d81525
commit
24b2fba170
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
home-assistant.log
|
||||||
home-assistant.conf
|
home-assistant.conf
|
||||||
known_devices.csv
|
known_devices.csv
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@ import datetime as dt
|
|||||||
|
|
||||||
import homeassistant.util as util
|
import homeassistant.util as util
|
||||||
|
|
||||||
logging.basicConfig(level=logging.INFO)
|
|
||||||
|
|
||||||
MATCH_ALL = '*'
|
MATCH_ALL = '*'
|
||||||
|
|
||||||
DOMAIN = "homeassistant"
|
DOMAIN = "homeassistant"
|
||||||
|
@ -15,6 +15,18 @@ def from_config_file(config_path):
|
|||||||
""" Starts home assistant with all possible functionality
|
""" Starts home assistant with all possible functionality
|
||||||
based on a config file. """
|
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__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
statusses = []
|
statusses = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user