guix-devel
[Top][All Lists]
Advanced

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

[PATCH shepherd] service: Add custom printer for <service>.


From: attila . lendvai
Subject: [PATCH shepherd] service: Add custom printer for <service>.
Date: Sun, 30 Jun 2024 18:12:59 +0200

From: Attila Lendvai <attila@lendvai.name>

* modules/shepherd/service.scm (print-service): New function.
---
 modules/shepherd/service.scm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 8c9d1c6..b018e39 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -34,6 +34,7 @@
   #:use-module (fibers timers)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
+  #:use-module (srfi srfi-9 gnu)
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module ((srfi srfi-35) #:hide (make-condition))
@@ -358,6 +359,11 @@ Log abnormal termination reported by @var{status}."
   ;; requests such as 'start' and 'stop' on this channel.
   (control   %service-control set-service-control!))
 
+(define (print-service service port)
+  (format port "#<service ~s>" (service-canonical-name service)))
+
+(set-record-type-printer! <service> print-service)
+
 (define* (service provision
                   #:key
                   (requirement '())

base-commit: 9f2d5ea865a7a769fe2c7ef5cd13ff84cf277ec5
-- 
2.45.2




reply via email to

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