From d2683f020fd05cc73318eab825b1cd8bc23e9714 Mon Sep 17 00:00:00 2001 From: Charles Day Date: Tue, 10 Jun 2008 16:50:35 +0000 Subject: [PATCH] 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 --- src/scm/main.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scm/main.scm b/src/scm/main.scm index 2f3a85a15b..8ab94eb452 100644 --- a/src/scm/main.scm +++ b/src/scm/main.scm @@ -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