Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Error Log entries now contain the specified arguments

Signed-off-by: Armin Wieser <armin.wieser@gmail.com>
  • Loading branch information...
commit 40ee38c150e521310b2057d927a63495a9ddd743 1 parent de30574
@awieser awieser authored
Showing with 12 additions and 6 deletions.
  1. +7 −3 memacs/lib/loggingsettings.py
  2. +5 −3 memacs/lib/memacs.py
View
10 memacs/lib/loggingsettings.py
@@ -1,12 +1,15 @@
# -*- coding: utf-8 -*-
-# Time-stamp: <2011-10-28 15:13:31 aw>
+# Time-stamp: <2012-04-11 18:48:26 armin>
import logging
import sys
import os
-def handle_logging(verbose=False, suppressmessages=False, org_file=""):
+def handle_logging(args,
+ verbose=False,
+ suppressmessages=False,
+ org_file=""):
"""
Handle/format logging regarding boolean parameter verbose
@param verbose: options from OptionParser
@@ -32,7 +35,8 @@ def handle_logging(verbose=False, suppressmessages=False, org_file=""):
console.setLevel(logging.ERROR)
formatter = logging.Formatter(
'** %(asctime)s ' + memacs_module_filename + \
- ' had an %(levelname)s \n %(message)s',
+ ' had an %(levelname)s \n %(message)s \n' + \
+ ' Arguments: ' + str(args) + '\n',
datefmt="<%Y-%m-%d %a %H:%M:%S +1d>")
console.setFormatter(formatter)
logging.getLogger('').addHandler(console)
View
8 memacs/lib/memacs.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Time-stamp: <2011-12-28 20:22:49 armin>
+# Time-stamp: <2012-04-11 18:46:03 armin>
import logging
import traceback
@@ -85,9 +85,11 @@ def __init(self, test=False):
# parse all arguments
self._parser_parse_args()
# set logging configuration
- handle_logging(self._args.verbose,
+ handle_logging(self._args.__dict__,
+ self._args.verbose,
self._args.suppressmessages,
- self._args.outputfile)
+ self._args.outputfile,
+ )
# for testing purposes it's good to see which args are secified
logging.debug("args specified:")
Please sign in to comment.
Something went wrong with that request. Please try again.