summaryrefslogtreecommitdiffstats
path: root/litecli/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'litecli/main.py')
-rw-r--r--litecli/main.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/litecli/main.py b/litecli/main.py
index e608da7..268ede2 100644
--- a/litecli/main.py
+++ b/litecli/main.py
@@ -239,7 +239,11 @@ class LiteCli(object):
log_file = self.config["main"]["log_file"]
if log_file == "default":
log_file = config_location() + "log"
- ensure_dir_exists(log_file)
+ try:
+ ensure_dir_exists(log_file)
+ except OSError:
+ # Unable to create log file, log to temp directory instead.
+ log_file = "/tmp/litecli.log"
log_level = self.config["main"]["log_level"]