Author: reinhard Date: 2011-04-18 03:59:06 -0500 (Mon, 18 Apr 2011) New Revision: 10314
Modified: trunk/gnue-common/ trunk/gnue-common/src/base/errors.py trunk/gnue-common/src/base/log.py Log: Never include exception name and message in details, and always print exception name and message additionally to details. Property changes on: trunk/gnue-common ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2011-04-18 10:03:25.819999933 +0200 committer: Reinhard Müller <[email protected]> properties: branch-nick: common + timestamp: 2011-04-18 10:55:02.470999956 +0200 committer: Reinhard Müller <[email protected]> properties: branch-nick: common Name: bzr:file-ids - src/base/errors.py 9803@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fbase%2Ferrors.py + src/base/errors.py 9803@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fbase%2Ferrors.py src/base/log.py 9758@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-common:src%2Fbase%2Flog.py Name: bzr:revision-id:v4 - 3116 [email protected] 3117 [email protected] 3118 [email protected] 3119 [email protected] 3120 [email protected] 3121 [email protected] 3122 [email protected] 3123 [email protected] 3124 [email protected] 3125 [email protected] 3126 [email protected] 3127 [email protected] 3128 [email protected] 3129 [email protected] 3130 [email protected] 3131 [email protected] 3132 [email protected] 3133 [email protected] 3134 [email protected] 3135 [email protected] 3136 [email protected] 3137 [email protected] 3138 [email protected] 3139 [email protected] 3140 [email protected] 3141 [email protected] 3142 [email protected] 3143 [email protected] 3144 [email protected] 3145 [email protected] 3146 [email protected] 3147 [email protected] 3148 [email protected] 3149 [email protected] 3150 [email protected] 3151 whizman_software_solutions_www.whizman.com-20110131200839-1fm0kcoi0hn3u14c 3152 whizman.com-20110217020317-icwlxpg3y0q9w8g5 3153 [email protected] + 3116 [email protected] 3117 [email protected] 3118 [email protected] 3119 [email protected] 3120 [email protected] 3121 [email protected] 3122 [email protected] 3123 [email protected] 3124 [email protected] 3125 [email protected] 3126 [email protected] 3127 [email protected] 3128 [email protected] 3129 [email protected] 3130 [email protected] 3131 [email protected] 3132 [email protected] 3133 [email protected] 3134 [email protected] 3135 [email protected] 3136 [email protected] 3137 [email protected] 3138 [email protected] 3139 [email protected] 3140 [email protected] 3141 [email protected] 3142 [email protected] 3143 [email protected] 3144 [email protected] 3145 [email protected] 3146 [email protected] 3147 [email protected] 3148 [email protected] 3149 [email protected] 3150 [email protected] 3151 whizman_software_solutions_www.whizman.com-20110131200839-1fm0kcoi0hn3u14c 3152 whizman.com-20110217020317-icwlxpg3y0q9w8g5 3153 [email protected] 3154 [email protected] Name: bzr:text-parents - src/base/errors.py [email protected] + src/base/log.py [email protected] Modified: trunk/gnue-common/src/base/errors.py =================================================================== --- trunk/gnue-common/src/base/errors.py 2011-04-18 08:59:03 UTC (rev 10313) +++ trunk/gnue-common/src/base/errors.py 2011-04-18 08:59:06 UTC (rev 10314) @@ -339,12 +339,12 @@ if isinstance(evalue, Error) and evalue.detail is not None: detail = evalue.detail else: - lines = traceback.format_exception(etype, evalue, etraceback) + lines = traceback.format_tb(etraceback) # Delete lines in the traceback as requested. if tb_skip: del lines[1:tb_skip + 1] - # traceback.format_exception() returns an 8 bit string encoded in the + # traceback.format_tb() returns an 8 bit string encoded in the # current encoding, so we have to convert to Unicode. - detail = i18n.inconv(''.join(lines)) + detail = i18n.inconv("".join(lines)) return (group, name, message, detail) Modified: trunk/gnue-common/src/base/log.py =================================================================== --- trunk/gnue-common/src/base/log.py 2011-04-18 08:59:03 UTC (rev 10313) +++ trunk/gnue-common/src/base/log.py 2011-04-18 08:59:06 UTC (rev 10314) @@ -373,7 +373,7 @@ (group, name, message, detail) = errors.format_exception(etype, evalue, etraceback) logger = "exception.%s.%s" % (group, name) - text = u_("Unhandled exception %s:\n%s") % (name, detail) + text = u_("Unhandled exception %s: %s\n%s") % (name, message, detail) error_n(logger, text) @@ -398,7 +398,7 @@ # module, since we want to show the details as returned by get_exception # instead of the standard traceback. (group, name, message, detail) = errors.get_exception() - error(msg + '\n' + detail, *args, **kwargs) + error(msg + ": " + name + ": " + message + "\n" + detail, *args, **kwargs) return True # ----------------------------------------------------------------------------- @@ -409,7 +409,7 @@ the current call stack. """ - debug(msg + '\n' + ''.join(traceback.format_stack( + debug(msg + "\n" + "".join(traceback.format_stack( inspect.currentframe().f_back)), *args, **kwargs) @@ -435,8 +435,9 @@ # We don't use the standard exception handling feature in Python's logging # module, since we want to show the details as returned by get_exception # instead of the standard traceback. - (group, name, message, detail) = errors.get_exception() - error_n(msg + '\n' + detail, *args, **kwargs) + (group, ename, message, detail) = errors.get_exception() + error_n(name, msg + "\n" + ename + ": " + message + "\n" + detail, *args, + **kwargs) return True # ----------------------------------------------------------------------------- @@ -447,7 +448,7 @@ including information about the current call stack. """ - debug_n(name, msg + '\n' + ''.join(traceback.format_stack( + debug_n(name, msg + "\n" + "".join(traceback.format_stack( inspect.currentframe().f_back)), *args, **kwargs) _______________________________________________ commit-gnue mailing list [email protected] http://lists.gnu.org/mailman/listinfo/commit-gnue
