From b6143cf42949fad797e9dc33d5c93110a442b81e Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 24 Mar 2013 21:04:09 +0400 Subject: [PATCH] Readd log_ prefix and expand log_file --- powerline/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/powerline/__init__.py b/powerline/__init__.py index a3a80420..845081fe 100644 --- a/powerline/__init__.py +++ b/powerline/__init__.py @@ -138,7 +138,7 @@ class Powerline(object): # Create logger if not logger: - log_format = common_config.get('format', '%(asctime)s:%(levelname)s:%(message)s') + log_format = common_config.get('log_format', '%(asctime)s:%(levelname)s:%(message)s') formatter = logging.Formatter(log_format) level = getattr(logging, common_config.get('log_level', 'WARNING')) @@ -162,8 +162,9 @@ class Powerline(object): :return: logging.Handler subclass. ''' - log_file = common_config.get('file', None) + log_file = common_config.get('log_file', None) if log_file: + log_file = os.path.expanduser(log_file) log_dir = os.path.dirname(log_file) if not os.path.isdir(log_dir): os.mkdir(log_dir)