From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id AOlFMOmhKWTT1gAASxT56A (envelope-from ) for ; Sun, 02 Apr 2023 17:40:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oNL4L+mhKWSXWgEAauVa8A (envelope-from ) for ; Sun, 02 Apr 2023 17:40:25 +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 5F642FBCD for ; Sun, 2 Apr 2023 17:40:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pizoO-0008QO-Ct; Sun, 02 Apr 2023 11:40: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 1pizoM-0008Q8-4w for guix-patches@gnu.org; Sun, 02 Apr 2023 11:40:06 -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 1pizoI-00046o-GU for guix-patches@gnu.org; Sun, 02 Apr 2023 11:40:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pizoH-0007fW-TF for guix-patches@gnu.org; Sun, 02 Apr 2023 11:40:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62490] [PATCH] services: nginx: Make logging level configurable. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 02 Apr 2023 15:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62490 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Bruno Victal Cc: 62490@debbugs.gnu.org, mail@cbaines.net, maxim.cournoyer@gmail.com Received: via spool by 62490-submit@debbugs.gnu.org id=B62490.168044999429458 (code B ref 62490); Sun, 02 Apr 2023 15:40:01 +0000 Received: (at 62490) by debbugs.gnu.org; 2 Apr 2023 15:39:54 +0000 Received: from localhost ([127.0.0.1]:42462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pizo9-0007f3-Lm for submit@debbugs.gnu.org; Sun, 02 Apr 2023 11:39:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pizo6-0007en-Ou for 62490@debbugs.gnu.org; Sun, 02 Apr 2023 11:39:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pizo0-00042r-RA; Sun, 02 Apr 2023 11:39:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=wQSWyJW8knLEgkUWZadbnpiix8L0tlEBX6je/Wv3cW4=; b=aXW9v2xRu8Dx3dtW62kW NyxN4ax9jTUNF0KMuPUXepC03Nc9TrzAl2yeAV/bYjcACecXzXNjNdPVK5PSVHQT0zZNebRy5CdzX Tx/lsGgPbzYLd2484dgsj7FuV3QazgoyUT4dUaY31y7LQlLf0ABKEUg1JKbESn5U6scR4yoOcDA8d n4Sqn/Tu1TDkpG7A9YTfJZV3JATqr25cbFFmy73gG8M2RK2Q+pR7UfH/iLcPDT+dUYj5BCiP1hXy2 vEHHQeNwbfYjdGXoOddlocZIYHFdYulXJKdq3cVNL7QbqY2DT5+CwoHsftb+YJ6AsSJPGtVJyJwFL qiXHeNPJinK0LQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pizo0-0003oJ-4W; Sun, 02 Apr 2023 11:39:44 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Sun, 02 Apr 2023 17:39:41 +0200 In-Reply-To: (Bruno Victal's message of "Mon, 27 Mar 2023 19:51:04 +0100") Message-ID: <87jzyuths2.fsf@gnu.org> 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=1680450025; a=rsa-sha256; cv=none; b=O5R7TR9TLJotfr7PFelyfFxpLQk2fXMbUigTp7MYCFWfHuoIuX+VUTuc5fyBFcyI/1Q+WL ox4x5M1tQL4oRTqj6qjVbRdvG/tSsRSV8DjVlOIEo86T4k+jBuhMUyAqmEZ3P6PdoiBU85 iw81vsQGsR63rLmUgYaTLNEwA3EmVb323xO0pATaicAR7dF5qmAUsOQB3Ijz4LBlmpaEwN /XdhW2FiUCmloipdDbx6RAkQObs5k/aUnM2ssWRFS0b2KCXIUg4HAxt1TlKb0mK3Wiy5Hs cDCusUCE5HcQUhgSS7JH2NA7oM8DuzzNrEzsvUfA10GUckyF/ZsuMqaDfqjpRg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=aXW9v2xR; dmarc=pass (policy=none) header.from=gnu.org; 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=1680450025; 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-cc: 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=wQSWyJW8knLEgkUWZadbnpiix8L0tlEBX6je/Wv3cW4=; b=h3iZJvPmfrAiYAirbTLE/o1VaBCfwBq0hzFsKzxe4L0t4q6mgV5GWFGjqoMuYfb6SCtsfF YnWTtxAG1QrBt9vXycqO54NlGTx8AvCEIjiD2hScuLVRm7CTPAE63J4s38WqBd09w/NDf7 9ieZI5RuJwNW6x/bjgrvzphVsPSgZrNQ2D4hmuYqDtQnfecJU4gFAszQdK7l1ml+djY7wj 6k5lKjwLiYbnHpZDxbLaUz+sahvgKXevUKSL5D7OiC1qGxyR7kx5OAYnKbs6x5mCaK6CZL 99PmNDBrWtLq+LgnxP6qOWWeSgO5kwYtuzYY+G0NJF+P37NNlWO/mf0zRmqM/Q== X-Migadu-Spam-Score: -1.13 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=aXW9v2xR; dmarc=pass (policy=none) header.from=gnu.org; 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: -1.13 X-Migadu-Queue-Id: 5F642FBCD X-TUID: v1IhAC3cGxtV 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{'noti= ce}, > +@code{'warn}, @code{'error}, @code{'crit}, @code{'alert}, or @code{'emer= g}." As it turns out, =E2=80=98define-compile-time-procedure=E2=80=99 cannot wor= k 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-enumerate-= type=E2=80=99 Making it a procedure is prolly good enough. The compiler can optimize it out at compile time, FWIW: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,optimize (unless (memq 'debug '(debug info)) (throw '= x)) $13 =3D (if #f #f) --8<---------------cut here---------------end--------------->8--- Ludo=E2=80=99.