AUDIT: r17209 - gnucash/trunk/src/scm - Scheme: Send backtraces to the gnucash.trace log as well as the console.

Charles Day cedayiv at cvs.gnucash.org
Tue Jun 10 12:50:36 EDT 2008


Author: cedayiv
Date: 2008-06-10 12:50:35 -0400 (Tue, 10 Jun 2008)
New Revision: 17209
Trac: http://svn.gnucash.org/trac/changeset/17209

Modified:
   gnucash/trunk/src/scm/main.scm
Log:
Scheme: Send backtraces to the gnucash.trace log as well as the console.
BP


Modified: gnucash/trunk/src/scm/main.scm
===================================================================
--- gnucash/trunk/src/scm/main.scm	2008-06-10 03:30:43 UTC (rev 17208)
+++ gnucash/trunk/src/scm/main.scm	2008-06-10 16:50:35 UTC (rev 17209)
@@ -130,8 +130,18 @@
 (define (gnc:backtrace-if-exception proc . args)
   (define (dumper key . args)
     (let ((stack (make-stack #t dumper)))
+      ;; Send debugging output to the console.
       (display-backtrace stack (current-error-port))
       (apply display-error stack (current-error-port) args)
+
+      ;; Send debugging output to the log.
+      (if (defined? 'gnc:warn)
+          (let ((string-port (open-output-string)))
+            (display-backtrace stack string-port)
+            (apply display-error stack string-port args)
+            (gnc:warn (get-output-string string-port))
+            (close-output-port string-port)))
+
       (throw 'ignore)))
   
   (catch 



More information about the gnucash-changes mailing list