guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Ludovic Courtès
Date: Tue, 26 Sep 2023 06:26:31 -0400 (EDT)

branch: master
commit 15e9301a1f5f3309d8d440c3f01896438f6fc026
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Sep 26 11:35:25 2023 +0200

    parameters: Remove ‘%debug’ in favor of ‘current-logging-level’.
    
    * src/cuirass/parameters.scm <top level>: Re-export ‘current-logging-level’.
    (%debug): Remove.
    * src/cuirass/scripts/remote-server.scm: Remove all (%debug) conditionals.
---
 src/cuirass/parameters.scm            |  9 +++------
 src/cuirass/scripts/remote-server.scm | 15 ++++++---------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/src/cuirass/parameters.scm b/src/cuirass/parameters.scm
index 63b0a45..f71d5bc 100644
--- a/src/cuirass/parameters.scm
+++ b/src/cuirass/parameters.scm
@@ -17,9 +17,9 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (cuirass parameters)
-  #:export (%debug
-
-            %cuirass-database
+  #:use-module ((cuirass logging) #:select (current-logging-level))
+  #:re-export (current-logging-level)
+  #:export (%cuirass-database
             %cuirass-host
             %cuirass-url
 
@@ -34,9 +34,6 @@
 ;; This variable is looked up by 'mu-message-send'.
 (define-public mu-debug 0)
 
-(define %debug
-  (make-parameter #false))
-
 ;; The Cuirass PostgreSQL database name.
 (define %cuirass-database
   (make-parameter "cuirass"))
diff --git a/src/cuirass/scripts/remote-server.scm 
b/src/cuirass/scripts/remote-server.scm
index f9589f4..bb7c7f8 100644
--- a/src/cuirass/scripts/remote-server.scm
+++ b/src/cuirass/scripts/remote-server.scm
@@ -258,7 +258,7 @@ be used to reply to the worker."
       (server-info-message peer-address (%log-port) (%publish-port))))
     (('worker-request-work name)
      (let ((worker (db-get-worker name)))
-       (when (and (%debug) worker)
+       (when worker
          (log-debug "~a (~a): request work."
                     (worker-address worker)
                     (worker-name worker)))
@@ -268,7 +268,7 @@ be used to reply to the worker."
                    (priority (build-priority build))
                    (timeout (build-timeout build))
                    (max-silent (build-max-silent-time build)))
-               (when (and (%debug) worker)
+               (when worker
                  (log-debug "~a (~a): build ~a submitted."
                             (worker-address worker)
                             (worker-name worker)
@@ -282,7 +282,7 @@ be used to reply to the worker."
                                        #:max-silent max-silent
                                        #:system (build-system build))))
              (begin
-               (when (and (%debug) worker)
+               (when worker
                  (log-debug "~a (~a): no available build."
                             (worker-address worker)
                             (worker-name worker)))
@@ -332,8 +332,7 @@ be used to reply to the worker."
 (define (trigger-substitutes-baking output url)
   (let* ((store-hash (strip-store-prefix output))
          (narinfo-url (publish-narinfo-url url store-hash)))
-    (when (%debug)
-      (log-debug "Bake: ~a" narinfo-url))
+    (log-debug "Bake: ~a" narinfo-url)
     (call-with-temporary-output-file
      (lambda (tmp-file port)
        (url-fetch* narinfo-url tmp-file)))))
@@ -362,12 +361,10 @@ at URL."
 required and #f otherwise."
   (match message
     (('build-succeeded ('drv drv) _ ...)
-     (when (%debug)
-       (log-debug "fetching required for ~a (success)" drv))
+     (log-debug "fetching required for ~a (success)" drv)
      #t)
     (('build-failed ('drv drv) _ ...)
-     (when (%debug)
-       (log-debug "fetching required for ~a (fail)" drv))
+     (log-debug "fetching required for ~a (fail)" drv)
      #t)
     (_ #f)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]