Mercurial > moin > 1.9
changeset 3157:b8cb12fa571b
logging: using more logging.exception
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Sat, 01 Mar 2008 17:10:35 +0100 |
parents | 1508feb6dbbf |
children | 3ea8d2e4af32 |
files | MoinMoin/config/multiconfig.py MoinMoin/xmlrpc/RemoteScript.py |
diffstat | 2 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py Sat Mar 01 16:41:33 2008 +0100 +++ b/MoinMoin/config/multiconfig.py Sat Mar 01 17:10:35 2008 +0100 @@ -47,7 +47,7 @@ except ImportError: raise except IndentationError, err: - logging.error(str(err)) + logging.exception('Your source code / config file is not correctly indented!') msg = '''IndentationError: %(err)s The configuration files are python modules. Therefore, whitespace is @@ -58,7 +58,7 @@ } raise error.ConfigurationError(msg) except Exception, err: - logging.error(str(err)) + logging.exception('An exception happened.') msg = '%s: %s' % (err.__class__.__name__, str(err)) raise error.ConfigurationError(msg) return module, mtime @@ -118,7 +118,7 @@ cfg.cfg_mtime = max(mtime, _farmconfig_mtime) logging.info("using wiki config: %s" % os.path.abspath(module.__file__)) except ImportError, err: - logging.error(str(err)) + logging.exception('Could not import.') msg = '''ImportError: %(err)s Check that the file is in the same directory as the server script. If @@ -134,7 +134,7 @@ } raise error.ConfigurationError(msg) except AttributeError, err: - logging.error(str(err)) + logging.exception('An exception occured.') msg = '''AttributeError: %(err)s Could not find required "Config" class in "%(name)s.py".
--- a/MoinMoin/xmlrpc/RemoteScript.py Sat Mar 01 16:41:33 2008 +0100 +++ b/MoinMoin/xmlrpc/RemoteScript.py Sat Mar 01 17:10:35 2008 +0100 @@ -26,8 +26,7 @@ logging.info("RemoteScript argv: %r" % argv) MoinScript(argv).run(showtime=0) except Exception, err: - e = str(err) - logging.error(e) - return xmlrpcobj._outstr(e) + logging.exception('An exception occurred.') + return xmlrpcobj._outstr(str(err)) return xmlrpcobj._outstr(u"OK")