From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 8D2SEjmVNWRfHQEASxT56A (envelope-from ) for ; Tue, 11 Apr 2023 19:13:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AIVjEjmVNWTwEgEA9RJhRA (envelope-from ) for ; Tue, 11 Apr 2023 19:13:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DB1463CB0A for ; Tue, 11 Apr 2023 19:13:28 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pmHYK-0002qe-GF; Tue, 11 Apr 2023 13:13:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pmHYE-0002W7-Hn for guix-patches@gnu.org; Tue, 11 Apr 2023 13:13:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pmHYE-0006XA-9A for guix-patches@gnu.org; Tue, 11 Apr 2023 13:13:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pmHYD-0003Rv-TJ for guix-patches@gnu.org; Tue, 11 Apr 2023 13:13:01 -0400 Subject: bug#62490: [PATCH] services: nginx: Make logging level configurable. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Tue, 11 Apr 2023 17:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 62490 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 62490-done@debbugs.gnu.org, Bruno Victal , mail@cbaines.net Mail-Followup-To: 62490@debbugs.gnu.org, maxim.cournoyer@gmail.com, mirai@makinata.eu Received: via spool by 62490-done@debbugs.gnu.org id=D62490.168123314613212 (code D ref 62490); Tue, 11 Apr 2023 17:13:01 +0000 Received: (at 62490-done) by debbugs.gnu.org; 11 Apr 2023 17:12:26 +0000 Received: from localhost ([127.0.0.1]:38094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmHXe-0003R2-95 for submit@debbugs.gnu.org; Tue, 11 Apr 2023 13:12:26 -0400 Received: from mail-qv1-f42.google.com ([209.85.219.42]:35774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pmHXb-0003Qn-RL for 62490-done@debbugs.gnu.org; Tue, 11 Apr 2023 13:12:24 -0400 Received: by mail-qv1-f42.google.com with SMTP id e9so5924218qvv.2 for <62490-done@debbugs.gnu.org>; Tue, 11 Apr 2023 10:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681233138; x=1683825138; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=q4Lu8BtTFeuAGyhIdbblIIpwreAd3RosQ19abSQsJZc=; b=B11SJFcKh3Q8LCw3TFNR8y7u9KGqH6dpB/YVVvOfK+L7xwUoINtIxjh2gXhW74KuUY d9KGUkC8m7GOK6qpR1T0cnoNAyS5vEYEdWC2HL8Mkhqq2q2+i8M0wKICBesRjjb2B8ip aoQSjbkZHV6RMMpmDc5jLNFXaHD5/erG+JM+OlkA6C1+0b/hFTmp8NVKts090QqUN2WV t7W9FtN62l70/Y7VoW26QfkA5B+ZACIBU8eFQHqMEfTJbBE3IKMw5QTplFFG+bExHska MLSNXlaqJSQhWSjoAoO0bi7M762qCiKM/VyWmUN2WBKK1wRgCHXTIqykLNgd+YPAT6xP Xxeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681233138; x=1683825138; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=q4Lu8BtTFeuAGyhIdbblIIpwreAd3RosQ19abSQsJZc=; b=ikPAG3BTZlTg+lPDBUvXRoNYiM634n2WxVEBZVeP9JV38FWBjZlWTAcRxu4sJwpHew d5J+9wh3aB//1ZHaGsdM3MgImy5xPo2VahU6Dug27pxPa+Smm00uQYXnrHZQQUnnQ49o oHFHfAVFjXFPTAdL41QFiRK0Wf/fcqq0zG55DGjH8bz0Ur3FghMh6Frf0bwvG1JzlJMG Vfa3eBXbTobDDexZwJ4JSsWUdUL+WX5Ssqf8uvcPkyuLhgqsZa1/rxzoIShxBUg60a7d kzfAsblN7IiKuZTk7vbkfKf7KrFjtjiD6ihC4kObe50vgrnIT8Of+A74zcNRw3b7nL7c FKOw== X-Gm-Message-State: AAQBX9dmbOPMkmBl/CBWDEBObPqtV6y8FPfjvPtGOqonLrmnF+uGlL5g Ox8JrAV59edtoj4/+6iJ+zc= X-Google-Smtp-Source: AKy350aTBgEi6hcDzX4PZ6pzzaq1NBM2HQvYhMbVuS11B+BSn+qw+aMnFVHojuhxCkMkVisvLMGoLg== X-Received: by 2002:a05:6214:19eb:b0:5ad:c532:67e6 with SMTP id q11-20020a05621419eb00b005adc53267e6mr6270628qvc.42.1681233138026; Tue, 11 Apr 2023 10:12:18 -0700 (PDT) Received: from hurd (dsl-152-224.b2b2c.ca. [66.158.152.224]) by smtp.gmail.com with ESMTPSA id cz10-20020a056214088a00b005e8d802ce32sm2985019qvb.143.2023.04.11.10.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 10:12:17 -0700 (PDT) From: Maxim Cournoyer References: <87jzyuths2.fsf@gnu.org> Date: Tue, 11 Apr 2023 13:12:16 -0400 In-Reply-To: <87jzyuths2.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sun, 02 Apr 2023 17:39:41 +0200") Message-ID: <87bkjumjgv.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681233208; a=rsa-sha256; cv=none; b=jgZPbBBeuFMCmmz5o0g89pFHCH6ty1fFu1Pk6q2DOTi3plr2ezS7sBuIZ6xNJzDPpbc89l TNq2FyL1XOyJ7mWyj23OOuhqa/vzNxbq7JJl443/S/cR2eCYbvU81sphVRyGkvPVBSv4sd zeyCFP8MgiJzROsdX43EjTE9OocQX7r/6+Kq9g8+cChlWaDy9yLbD7rX5PhCOw/LCIPYB7 0NdCsPLGVaR9pOsaaiRnaOKmLKXTkykC/0LkIgITPmM40d1yvab/7EPEJRMq5bEKJgWA/l iY8j3Htq5o8TVF+D2vMYOl4zb/6UrP9FhpZ9qC3t/zZCpckdAtQDdE0P31Or8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=B11SJFcK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681233208; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=q4Lu8BtTFeuAGyhIdbblIIpwreAd3RosQ19abSQsJZc=; b=I9LDsR0/aSZQ/vaABupZjZFSboqiD9rfaC50ttGH9zP9hfFs8vvY1YAAV90R+h2K7OuHJc uM04kmfTN+o3tRNgrIIUNrV01GpNsvnBhjp1znHEyiCshwKtx5l8XAdhjWhSS8XZgto+LH k8mVRlr1ZHO4l2Jmk5yXlx5NNe5xfKqOtTNIfJHI81vey+Fm6vLKetxX72GqzvozttHkyK HsBRxB3jlUPUdiveL+buoJJduUOIefWAd1ht9PmdhJSkYE1TJrvipAEsIr4IV9WVOsp5xv hRDUgzMz5THllf6hYlAgnTfPHJWOq5b1OgdsrxsuAsk/lT3rHmuoX+kWUKSs2w== X-Migadu-Spam-Score: 5.78 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=B11SJFcK; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Spam-Score: 5.78 X-Migadu-Queue-Id: DB1463CB0A X-TUID: 4ZFVQD1PqkHG Hi, Ludovic Court=C3=A8s writes: > Hi, > > Bruno Victal skribis: > >> +(define-compile-time-procedure (assert-valid-log-level (level symbol?)) >> + "Ensure @var{level} is one of @code{'debug}, @code{'info}, @code{'not= ice}, >> +@code{'warn}, @code{'error}, @code{'crit}, @code{'alert}, or @code{'eme= rg}." > > As it turns out, =E2=80=98define-compile-time-procedure=E2=80=99 cannot w= ork with > symbols. In short, that=E2=80=99s because in the end the generated macro > checks: > > (symbol? #'(quote debug)) > > which doesn=E2=80=99t do what we want. > > Anyway, you can either make it a regular procedure instead, or use a > trick found in R6RS and used in some places in Guix, Guile-Gcrypt, etc., > which is to define a macro that validates things: > > (endianness little) ;R6RS > > (operating-id valid-path?) ;(guix store), with =E2=80=98define-enumerat= e-type=E2=80=99 > > Making it a procedure is prolly good enough. The compiler can optimize > it out at compile time, FWIW: > > scheme@(guile-user)> ,optimize (unless (memq 'debug '(debug info)) (throw= 'x)) > $13 =3D (if #f #f) I've installed Bruno's v2, which reworked the above into a simple procedure. Closing! --=20 Thanks, Maxim