From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 74860@debbugs.gnu.org
Subject: [bug#74860] [PATCH 02/10] services: Add ‘log-rotation-service-type’.
Date: Thu, 02 Jan 2025 23:19:51 +0900 [thread overview]
Message-ID: <87seq15md4.fsf@gmail.com> (raw)
In-Reply-To: <97dd04a5fbb49bcacc4b7d61749f64c8c6fae9d5.1734129908.git.ludo@gnu.org> ("Ludovic Courtès"'s message of "Fri, 13 Dec 2024 23:58:22 +0100")
Hi Ludovic,
Ludovic Courtès <ludo@gnu.org> writes:
> * gnu/services/admin.scm (%default-log-rotation-calendar-event): New
> variable.
> (<log-rotation-configuration>): New record type.
> (log-rotation-shepherd-services): New procedure.
> (log-rotation-service-type): New variable.
Neat.
[...]
> +@item @code{compression} (default: @code{'gzip})
> +This is the compression method used for rotated log files, one of
> +@code{'none}, @code{'gzip}, and @code{'zstd}.
Why not default to zstd? It's superior to gzip in all regards, as far
as I know. We use it already preferably to gzip to compress man pages
for example. Perhaps we should consider it as our default compressor
from now on?
[...]
> +\f
> +;;;
> +;;; Shepherd's log rotation service.
> +;;;
> +
> +(define %default-log-rotation-calendar-event
> + ;; Default calendar event when log rotation is triggered.
> + #~(calendar-event #:minutes '(0)
> + #:hours '(22)
> + #:days-of-week '(sunday)))
> +
> +(define-record-type* <log-rotation-configuration>
> + log-rotation-configuration make-log-rotation-configuration
> + log-rotation-configuration?
> + (provision log-rotation-configuration-provision (default '(log-rotation)))
> + (requirement log-rotation-configuration-requirement
> + (default (if for-home? '() '(user-processes))))
> + (calendar-event log-rotation-configuration-calendar-event
> + (default %default-log-rotation-calendar-event))
> + (external-log-files log-rotation-configuration-external-log-files
> + (default '()))
> + (compression log-rotation-configuration-compression (default 'gzip))
> + (expiry log-rotation-configuration-expiry
> + (default #~(%default-log-expiry)))
> + (size-threshold log-rotation-configuration-size-threshold
> + (default #~(%default-rotation-size-threshold))))
Is there a technical reason for not using define-configuration here?
Otherwise, define-configuration offers superior error checking and
useful error messages on invalid input types.
If possible, I think it'd be nice to see this done with
define-configuration, for the reasons I explained above. Otherwise it
LGTM. Could you please send a v2 addressing this?
--
Thanks,
Maxim
next prev parent reply other threads:[~2025-01-02 14:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-13 22:55 [bug#74860] [PATCH 00/10] Using the Shepherd's log rotation service Ludovic Courtès
2024-12-13 22:58 ` [bug#74860] [PATCH 01/10] gnu: shepherd@1.0: Add dependency on gzip and zstd Ludovic Courtès
2024-12-13 22:58 ` [bug#74860] [PATCH 02/10] services: Add ‘log-rotation-service-type’ Ludovic Courtès
2025-01-02 14:19 ` Maxim Cournoyer [this message]
2025-01-04 18:16 ` Ludovic Courtès
2024-12-13 22:58 ` [bug#74860] [PATCH 03/10] services: log-cleanup: Rewrite as a Shepherd timer Ludovic Courtès
2025-01-02 14:24 ` Maxim Cournoyer
2024-12-13 22:58 ` [bug#74860] [PATCH 04/10] services: unattended-upgrade: " Ludovic Courtès
2025-01-02 14:28 ` Maxim Cournoyer
2024-12-13 22:58 ` [bug#74860] [PATCH 05/10] services: Switch from mcron + Rottlog to Shepherd’s log rotation Ludovic Courtès
2025-01-02 14:41 ` Maxim Cournoyer
2024-12-13 22:58 ` [bug#74860] [PATCH 06/10] services: rottlog: Deprecate Ludovic Courtès
2024-12-13 22:58 ` [bug#74860] [PATCH 07/10] DRAFT news: Add entry for ‘rottlog-service-type’ deprecation Ludovic Courtès
2024-12-14 18:34 ` pelzflorian (Florian Pelz)
2024-12-17 14:25 ` Ludovic Courtès
2024-12-13 22:58 ` [bug#74860] [PATCH 08/10] home: services: Add log rotation service Ludovic Courtès
2024-12-13 22:58 ` [bug#74860] [PATCH 09/10] home: Define ‘%base-home-services’ Ludovic Courtès
2025-01-02 14:34 ` Maxim Cournoyer
2024-12-13 22:58 ` [bug#74860] [PATCH 10/10] home: Add log rotation to ‘%base-home-services’ Ludovic Courtès
2025-01-02 14:34 ` Maxim Cournoyer
2024-12-13 23:20 ` [bug#74860] [PATCH 00/10] Using the Shepherd's log rotation service Ludovic Courtès
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87seq15md4.fsf@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=74860@debbugs.gnu.org \
--cc=ludo@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.