r17273 - gnucash/branches/2.2/src/scm - [r17209] Scheme: Send backtraces to the gnucash.trace log as well as the console.
Christian Stimming
cstim at cvs.gnucash.org
Mon Jul 7 16:55:45 EDT 2008
Author: cstim
Date: 2008-07-07 16:55:44 -0400 (Mon, 07 Jul 2008)
New Revision: 17273
Trac: http://svn.gnucash.org/trac/changeset/17273
Modified:
gnucash/branches/2.2/src/scm/main.scm
Log:
[r17209] Scheme: Send backtraces to the gnucash.trace log as well as the console.
Originally by cedayiv.
Modified: gnucash/branches/2.2/src/scm/main.scm
===================================================================
--- gnucash/branches/2.2/src/scm/main.scm 2008-07-07 20:55:36 UTC (rev 17272)
+++ gnucash/branches/2.2/src/scm/main.scm 2008-07-07 20:55:44 UTC (rev 17273)
@@ -144,8 +144,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