Only wipe old logging file when reason to write new one.

pull/2/head
Paulus Schoutsen 2014-01-29 21:41:03 -08:00
parent 24b2fba170
commit 086cf77443
1 changed files with 2 additions and 1 deletions

View File

@ -19,7 +19,8 @@ def from_config_file(config_path):
logging.basicConfig(level=logging.INFO)
# Log errors to a file
err_handler = logging.FileHandler("home-assistant.log", mode='w')
err_handler = logging.FileHandler("home-assistant.log",
mode='w', delay=True)
err_handler.setLevel(logging.ERROR)
err_handler.setFormatter(
logging.Formatter('%(asctime)s %(name)s: %(message)s',