[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#62490] [PATCH] services: nginx: Make logging level configurable.
From: |
Bruno Victal |
Subject: |
[bug#62490] [PATCH] services: nginx: Make logging level configurable. |
Date: |
Tue, 28 Mar 2023 15:32:56 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 |
Hi Maxim,
On 2023-03-28 15:12, Maxim Cournoyer wrote:
> Bruno Victal <mirai@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>.
Cheers,
Bruno