unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: attila.lendvai@gmail.com
To: guix-devel@gnu.org
Cc: Attila Lendvai <attila@lendvai.name>
Subject: [PATCH shepherd] service: Add custom printer for <service>.
Date: Sun, 30 Jun 2024 18:12:59 +0200	[thread overview]
Message-ID: <20240630161303.22507-2-attila@lendvai.name> (raw)

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	other threads:[~2024-06-30 17:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-30 16:12 attila.lendvai [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240630161303.22507-2-attila@lendvai.name \
    --to=attila.lendvai@gmail.com \
    --cc=attila@lendvai.name \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).