From 4318f7a3c7825aedab87b32b27601f67983343e0 Mon Sep 17 00:00:00 2001 From: Mike Alexander Date: Fri, 6 Mar 2020 03:31:59 -0500 Subject: [PATCH] Revert "completion redefine gnc:debug" and fix some bugs in it This change made it impossible to turn debug output on or off on the fly by calling qof-log-set-level from Scheme code. The optimization achieved isn't all that great either since the arguements to gnc:debug are still evaluated when debugging is off and this is where a lot of the overhead is. Even without this change the call to strify is avoided. Also fixed the parameters of qof-log-check: "gmc" => "gnc.scm" G-LOG-LEVEL-DEBUG => QOF-LOG-DEBUG This reverts commit b3a4cd62775705b2543438f912ca71dad591bf0e. --- libgnucash/scm/utilities.scm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/libgnucash/scm/utilities.scm b/libgnucash/scm/utilities.scm index 4fcf60b823..c70f4544a5 100644 --- a/libgnucash/scm/utilities.scm +++ b/libgnucash/scm/utilities.scm @@ -68,18 +68,9 @@ (define (gnc:msg . items) (gnc-scm-log-msg (strify items))) -;; this definition of gnc:debug is different from others because we -;; want to check loglevel is debug *once* at gnc:debug definition -;; instead of every call to gnc:debug. if loglevel isn't debug then -;; gnc:debug becomes a NOOP. -(define gnc:debug - (cond - ((qof-log-check "gnc" QOF-LOG-DEBUG) - (display "debugging enabled\n") - (lambda items (gnc-scm-log-debug (strify items)))) - - (else - (lambda items #f)))) +(define (gnc:debug . items) + (when (qof-log-check "gnc:scm" QOF-LOG-DEBUG) + (gnc-scm-log-debug (strify items)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; the following functions are initialized to log message to tracefile