From 086cf774438d0ad6105f24c16efc71afef397581 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 29 Jan 2014 21:41:03 -0800 Subject: [PATCH] Only wipe old logging file when reason to write new one. --- homeassistant/bootstrap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/bootstrap.py b/homeassistant/bootstrap.py index 1bc6ef19edb..3343caa4370 100644 --- a/homeassistant/bootstrap.py +++ b/homeassistant/bootstrap.py @@ -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',