summaryrefslogtreecommitdiff
path: root/alot/init.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/init.py')
-rwxr-xr-xalot/init.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/alot/init.py b/alot/init.py
index 5ce1d586..34d3810a 100755
--- a/alot/init.py
+++ b/alot/init.py
@@ -138,7 +138,12 @@ def main():
numeric_loglevel = getattr(logging, args['debug-level'].upper(), None)
logfilename = os.path.expanduser(args['logfile'])
logging.basicConfig(level=numeric_loglevel, filename=logfilename)
+ log_formatter = logging.Formatter('%(levelname)s:%(message)s')
+ log_handler = logging.FileHandler(logfilename, encoding='utf-8')
+ log_handler.setFormatter(log_formatter)
logger = logging.getLogger()
+ logger.setLevel(numeric_loglevel)
+ logger.addHandler(log_handler)
#logger.debug(commands.COMMANDS)
# get ourselves a database manager