Scheme: Send backtraces to the gnucash.trace log as well as the console.

BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17209 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Charles Day 2008-06-10 16:50:35 +00:00
parent 5743752704
commit d2683f020f

View File

@ -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