GNU bug report logs - #62490
[PATCH] services: nginx: Make logging level configurable.

Previous Next

Package: guix-patches;

Reported by: Bruno Victal <mirai <at> makinata.eu>

Date: Mon, 27 Mar 2023 18:52:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Bruno Victal <mirai <at> makinata.eu>
Cc: 62490 <at> debbugs.gnu.org, ludo <at> gnu.org, mail <at> cbaines.net
Subject: [bug#62490] [PATCH] services: nginx: Make logging level configurable.
Date: Tue, 28 Mar 2023 11:03:45 -0400
OK,

Bruno Victal <mirai <at> makinata.eu> writes:

> Hi Maxim,
>
> On 2023-03-28 15:12, Maxim Cournoyer wrote:
>> Bruno Victal <mirai <at> makinata.eu> writes:
>>>  
>>> +(define-compile-time-procedure (assert-valid-log-level (level symbol?))
>>> +  "Ensure @var{level} is one of @code{'debug}, @code{'info}, @code{'notice},
>>> +@code{'warn}, @code{'error}, @code{'crit}, @code{'alert}, or @code{'emerg}."
>>> +  (unless (memq level '(debug info notice warn error crit alert emerg))
>>> +    (raise
>>> +     (make-compound-condition
>>> +      (formatted-message (G_ "unknown log level '~a'") level)
>>> +      (condition (&error-location
>>> +                  (location
>>> +                   (source-properties->location procedure-call-location)))))))
>>> +  level)
>> 
>> It's the first time I've seen define-compile-time-procedure in actual
>> use.  Is it really necessary?  What happens if you omit wrapping
>> assert-valid-log-level with it?
>
> It will still work, provided the declaration is adjusted accordingly.
> As for the reasons and benefits of using define-compile-time-procedure,
> it's best explained at <https://logs.guix.gnu.org/guix/2023-03-20.log#131047>.

I guess it's not actually useful here, since none of the fields thunked?

As another note, the nginx-configuration record looks simple enough that
perhaps it'd best be migrated to use the define-configuration method,
which could be made as a prior commit to this change.

As a benefit it'd validate the other field types as well.

-- 
Thanks,
Maxim




This bug report was last modified 2 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.