diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-05 04:54:28 -0800 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2012-01-05 04:54:28 -0800 |
commit | d4922e95450cf4587d58d9eb3abee1e8c768d2fd (patch) | |
tree | 08d44bae2809b57a10ade293a4cec19a7d0be373 /alot | |
parent | 5188139b513f89c2d3610166e39808be3840e355 (diff) | |
parent | 2872b718cc8489601c99646ddba2af9a047acb99 (diff) |
Merge pull request #232 from 0x64746b/fix_logging
Fix logging
Diffstat (limited to 'alot')
-rwxr-xr-x | alot/init.py | 5 |
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 |