summary refs log tree commit diff
path: root/gnu/services
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-10-18 22:37:20 +0200
committerLudovic Courtès <ludo@gnu.org>2019-10-18 23:22:25 +0200
commit6aeae5b90b9513d316141c0131fd43c76a200f63 (patch)
tree48f3b5a671a26aef6c78ba7eb903acbb3d18c523 /gnu/services
parent17a5cb45d444104e28cf7c42e15a5ed5e761a555 (diff)
downloadguix-6aeae5b90b9513d316141c0131fd43c76a200f63.tar.gz
herd: Define 'shepherd-message-port'.
* gnu/services/herd.scm (shepherd-message-port): New variable.
(display-message): Use it instead of 'current-error-port'.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/herd.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm
index 2207b2d34b..112a7dc104 100644
--- a/gnu/services/herd.scm
+++ b/gnu/services/herd.scm
@@ -25,6 +25,7 @@
   #:use-module (srfi srfi-35)
   #:use-module (ice-9 match)
   #:export (%shepherd-socket-file
+            shepherd-message-port
 
             shepherd-error?
             service-not-found-error?
@@ -140,8 +141,12 @@ does not denote an error."
     (#f                                           ;not an error
      #t)))
 
+(define shepherd-message-port
+  ;; Port where messages coming from shepherd are printed.
+  (make-parameter (current-error-port)))
+
 (define (display-message message)
-  (format (current-error-port) "shepherd: ~a~%" message))
+  (format (shepherd-message-port) "shepherd: ~a~%" message))
 
 (define* (invoke-action service action arguments cont)
   "Invoke ACTION on SERVICE with ARGUMENTS.  On success, call CONT with the