summaryrefslogtreecommitdiff
path: root/alot/init.py
diff options
context:
space:
mode:
authordtk <dtk@gmx.de>2012-01-05 16:46:19 +0100
committerdtk <dtk@gmx.de>2012-01-05 17:13:55 +0100
commitd2599fe506ab6156ee7f2513caf64cc6a03d3b29 (patch)
treea1830754ac08146f773d3596b305b303916ca9a5 /alot/init.py
parentd4922e95450cf4587d58d9eb3abee1e8c768d2fd (diff)
Purge logging object
Consistently use module functions instead. Introduce a non-default log format that replaces the logger name with the module name. Cf issue #170. Closes #231.
Diffstat (limited to 'alot/init.py')
-rwxr-xr-xalot/init.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/alot/init.py b/alot/init.py
index 34d3810a..d9405078 100755
--- a/alot/init.py
+++ b/alot/init.py
@@ -137,15 +137,11 @@ def main():
# setup logging
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)
+ logformat = '%(levelname)s:%(module)s:%(message)s'
+ logging.basicConfig(level=numeric_loglevel, filename=logfilename,
+ format=logformat)
+
+ #logging.debug(commands.COMMANDS)
# get ourselves a database manager
dbman = DBManager(path=args['mailindex-path'], ro=args['read-only'])
@@ -171,7 +167,6 @@ def main():
# set up and start interface
UI(dbman,
- logger,
aman,
cmd,
args['colour-mode'],