unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH shepherd] service: Add custom printer for <service>.
@ 2024-06-30 16:12 attila.lendvai
  2024-06-30 16:13 ` [PATCH shepherd] service: Rename to QUERY-SERVICE-CONTROLLER and use CUT attila.lendvai
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: attila.lendvai @ 2024-06-30 16:12 UTC (permalink / raw)
  To: guix-devel; +Cc: Attila Lendvai

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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-06-30 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-30 16:12 [PATCH shepherd] service: Add custom printer for <service> attila.lendvai
2024-06-30 16:13 ` [PATCH shepherd] service: Rename to QUERY-SERVICE-CONTROLLER and use CUT attila.lendvai
2024-06-30 16:13 ` [PATCH shepherd] service: Factor out SEND-TO-PROCESS-MONITOR attila.lendvai
2024-06-30 16:13 ` [PATCH shepherd] service: Factor out SEND-TO-REGISTRY attila.lendvai
2024-06-30 16:13 ` [PATCH shepherd] service: Factor out SEND-TO-SERVICE-CONTROLLER attila.lendvai

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).