[Zope-CVS] CVS: Packages/zasync/client/zasync - __init__.py:1.2 client.py:1.3 config.py:1.2 schema.xml:1.2 zasync.conf:1.2

Gary Poster gary at zope.com
Tue Oct 19 12:45:44 EDT 2004


Update of /cvs-repository/Packages/zasync/client/zasync
In directory cvs.zope.org:/tmp/cvs-serv25783

Modified Files:
	__init__.py client.py config.py schema.xml zasync.conf 
Log Message:
Make the verbose traceback optional, defaulting to False.



=== Packages/zasync/client/zasync/__init__.py 1.1.1.1 => 1.2 ===
--- Packages/zasync/client/zasync/__init__.py:1.1.1.1	Sun Oct 10 19:37:07 2004
+++ Packages/zasync/client/zasync/__init__.py	Tue Oct 19 12:45:44 2004
@@ -2,4 +2,4 @@
     from zasync import config
     conf = config.initialize(config_file)
     from zasync import client
-    client.run(conf.target_path)
\ No newline at end of file
+    client.run(conf.target_path)


=== Packages/zasync/client/zasync/client.py 1.2 => 1.3 ===
--- Packages/zasync/client/zasync/client.py:1.2	Thu Oct 14 12:36:35 2004
+++ Packages/zasync/client/zasync/client.py	Tue Oct 19 12:45:44 2004
@@ -43,6 +43,7 @@
 initial_retry_delay = 5
 retry_exponential_backoff = 1.1
 max_total_retry = 3600 # change to total max retry, 0 means no max
+verbose_traceback = False
 
 tool_path = None # this will hold the path to the Zope tool.  This variable
 # is intentionally not used directly in this file, but that may change.
@@ -88,15 +89,19 @@
     return app().__of__(RequestContainer(REQUEST=request))
 
 def logException(msg='', log=None):
+    global verbose_traceback
     if log is None:
         log = logging.getLogger('zasync')
     get_transaction().abort()
-    out = StringIO.StringIO()
-    res = failure.Failure()
-    res.printDetailedTraceback(out)
-    out = out.getvalue()
-    log.error(
-        'Logged Exception.  Transaction aborted.  %s\n\n%s', msg, out)
+    msg = 'Logged Exception.  Transaction aborted.  %s' % msg
+    if verbose_traceback:
+        res = failure.Failure()
+        out = StringIO.StringIO()
+        res.printDetailedTraceback(out)
+        out = out.getvalue()
+        log.error("%s\n\n%s\n\n%s", msg, out, res.getErrorMessage())
+    else:
+        log.error(msg, exc_info=True)
     return res
 
 def scheduleServerRetry(call, *args, **kwargs):
@@ -464,7 +469,7 @@
     finally:
         if tool is not None:
             tool._p_jar.close()
-    return value
+    return res
 
 def run(path=None):
     # to be called after config.initialize


=== Packages/zasync/client/zasync/config.py 1.1.1.1 => 1.2 ===
--- Packages/zasync/client/zasync/config.py:1.1.1.1	Sun Oct 10 19:37:11 2004
+++ Packages/zasync/client/zasync/config.py	Tue Oct 19 12:45:44 2004
@@ -145,6 +145,8 @@
         max(config.retry_exponential_backoff, 1))
     client.max_total_retry = max(config.max_total_retry, 0)
     
+    # configure traceback verbosity
+    client.verbose_traceback = config.verbose_traceback
     
     # load in plugins.  We don't want to calculate the callables until 
     # this root handler because the python environment is not set up until here.


=== Packages/zasync/client/zasync/schema.xml 1.1.1.1 => 1.2 ===
--- Packages/zasync/client/zasync/schema.xml:1.1.1.1	Sun Oct 10 19:37:12 2004
+++ Packages/zasync/client/zasync/schema.xml	Tue Oct 19 12:45:44 2004
@@ -214,6 +214,14 @@
      <metadefault>off</metadefault>
   </key>
 
+  <key name="verbose-traceback" datatype="boolean" default="off">
+     <description>
+     Set this directive to 'on' to cause zasync to produce very verbose
+     tracebacks, including the locals and globals for every frame.
+     </description>
+     <metadefault>off</metadefault>
+  </key>
+
   <multisection type="ZODB.Database" name="+" attribute="databases">
     <description>
        Zope ZODB databases must have a name, and they are required to be


=== Packages/zasync/client/zasync/zasync.conf 1.1.1.1 => 1.2 ===
--- Packages/zasync/client/zasync/zasync.conf:1.1.1.1	Sun Oct 10 19:37:13 2004
+++ Packages/zasync/client/zasync/zasync.conf	Tue Oct 19 12:45:44 2004
@@ -313,3 +313,16 @@
   level debug
   propagate yes
 </logger>
+
+
+# Directive: verbose-traceback
+#
+# Description:
+#     Set this directive to 'on' to cause  zasync to produce very verbose
+#     tracebacks, including the locals and globals for every frame.
+#
+# Default: off
+#
+# Example:
+#
+#    verbose-traceback on



More information about the Zope-CVS mailing list