aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-06-06 15:50:49 +0100
committerChristopher Baines <mail@cbaines.net>2024-06-06 16:32:56 +0100
commit846aa141c8393ccb74e65c0160eff36620955ef9 (patch)
tree52028b2a74b7659167057a23baf54fc6c3f6f2da /guix-build-coordinator
parentc18b7685779e402524466bc33309b641bc6a1861 (diff)
downloadbuild-coordinator-846aa141c8393ccb74e65c0160eff36620955ef9.tar
build-coordinator-846aa141c8393ccb74e65c0160eff36620955ef9.tar.gz
Support controlling adding timestamps to the log output
So this can be turned off when the shepherd is adding the timestamps.
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r--guix-build-coordinator/agent.scm11
-rw-r--r--guix-build-coordinator/coordinator.scm11
2 files changed, 14 insertions, 8 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm
index a64a61c..7c00ca1 100644
--- a/guix-build-coordinator/agent.scm
+++ b/guix-build-coordinator/agent.scm
@@ -77,7 +77,8 @@
derivation-substitute-urls
non-derivation-substitute-urls
metrics-file
- max-1min-load-average)
+ max-1min-load-average
+ timestamp-log-output?)
(define lgr (make <logger>))
(define port-log (make <port-log>
#:port (current-output-port)
@@ -85,9 +86,11 @@
;; In guile-lib v0.2.8 onwards, the formatter is
;; called with more arguments
(lambda args ; lvl, time, str
- (format #f "~a (~5a): ~a~%"
- (strftime "%F %H:%M:%S" (localtime
- (second args)))
+ (format #f "~a(~5a): ~a~%"
+ (if timestamp-log-output?
+ (strftime "%F %H:%M:%S " (localtime
+ (second args)))
+ "")
(first args)
(third args)))))
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm
index 63f9eaf..9e5987f 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -364,7 +364,8 @@
(not (client-error? exn))))))
hooks
(allocation-strategy
- basic-build-allocation-strategy))
+ basic-build-allocation-strategy)
+ (timestamp-log-output? #t))
(and (or (list? hooks)
(begin
(simple-format
@@ -398,9 +399,11 @@
;; In guile-lib v0.2.8 onwards, the formatter is
;; called with more arguments
(lambda args ; lvl, time, str
- (format #f "~a (~5a): ~a~%"
- (strftime "%F %H:%M:%S" (localtime
- (second args)))
+ (format #f "~a(~5a): ~a~%"
+ (if timestamp-log-output?
+ (strftime "%F %H:%M:%S " (localtime
+ (second args)))
+ "")
(first args)
(third args)))))
(build-coordinator