From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0DVoHqW902WAfwAAe85BDQ:P1 (envelope-from ) for ; Mon, 19 Feb 2024 21:44:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 0DVoHqW902WAfwAAe85BDQ (envelope-from ) for ; Mon, 19 Feb 2024 21:44:21 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=NHJxLFxI; 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=1708375461; 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=Zpq5x1MFUstEbmXxyqU4m42UP4GXxcgE82Vgr2u8pfo=; b=AL8er9Gou9f5PLFTSK//8ERvXY9husDv/4N9Mwvx8sHkm6FuMth6jEJP/IpxJMIRa4pscH ifgzz1gTj8K6wP/qNpq6Yu3cPRRU4OnBlYtvPqOPXtWYhViLWYpea8jDh9mQKZ4yskLAeD 1lx0K8DbdQUM8HB1lqnlRCgWMmaVlEZ689DHwFKrq5agtGTwRhyrOjGLuzipQxXTDE/8bn lErX2db4y1XCD1G0nzlnSnk/68p7qGyORNPoqHsLHPoLQXiqMqMsaYy97zvedkUIn4f0wd OkF3khPRMF4o0FLF59wwahGStRU1GJvX1uPSqOBsVlhJws2fzZXUfPI/acwR8w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=NHJxLFxI; 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-Seal: i=1; s=key1; d=yhetil.org; t=1708375461; a=rsa-sha256; cv=none; b=Rzye4YMyXF8tzpRhNI3InxLKucjMxKu8yTrbVvyDZT46t8tBb9KhsVFMkk/J5jdgpog319 yZjrxvuVFlHC7J+3dsUxCk19yS5XEHibWbxL/6SeoG8ES6mVMifYqIc7oWpphin+Eq7Min oVBbSzB91DuTxWvFJGH2C2fZmpcztvdkjVZP7MqBIcRmNJOemIPzX0mVyBstPXLzpVeNK/ PwD1OQpHVN/65GyKc3oFYHmdGk7i909tsR9jqqO9MlpxlyEtud96215qe0UNoC7X4gw6Rh aKvvEcTjOKMuS8dPVhPu1IL8dseIbu6AThjRPuRroDqrzWk0zf/7rPoLeCzFQQ== 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 26089131EE for ; Mon, 19 Feb 2024 21:44:21 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcAUR-0001JK-CT; Mon, 19 Feb 2024 15:43:51 -0500 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 1rcAUH-0001F7-Qv for guix-patches@gnu.org; Mon, 19 Feb 2024 15:43:44 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcAUH-0005MQ-Iz for guix-patches@gnu.org; Mon, 19 Feb 2024 15:43:41 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcAUc-0001Iy-Pf for guix-patches@gnu.org; Mon, 19 Feb 2024 15:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68946] [PATCH v2] guix: Add logging module. Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Feb 2024 20:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68946 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 68946@debbugs.gnu.org, Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tobias Geerinckx-Rice , Josselin Poiret , Ricardo Wurmus , Christopher Baines Received: via spool by 68946-submit@debbugs.gnu.org id=B68946.17083753874916 (code B ref 68946); Mon, 19 Feb 2024 20:44:02 +0000 Received: (at 68946) by debbugs.gnu.org; 19 Feb 2024 20:43:07 +0000 Received: from localhost ([127.0.0.1]:43558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcATi-0001H8-P7 for submit@debbugs.gnu.org; Mon, 19 Feb 2024 15:43:07 -0500 Received: from mail-wm1-f46.google.com ([209.85.128.46]:38956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcATa-0001G4-Lu for 68946@debbugs.gnu.org; Mon, 19 Feb 2024 15:43:04 -0500 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4125753b593so1866055e9.0 for <68946@debbugs.gnu.org>; Mon, 19 Feb 2024 12:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708375291; x=1708980091; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Zpq5x1MFUstEbmXxyqU4m42UP4GXxcgE82Vgr2u8pfo=; b=NHJxLFxIap6/yH+OL0hvIRpDDcpINJsbrJe7t10Wpd9e6/yUWKlwaDivH9KjPWEo9x cDSnVHyraEBkqk4CkWkQeq2bvcteIM31EnWjtijigB1RImfXTVpqh/sCtCoFjCn3SsSV oBflwp7luzH5yciIhZnY3PPTh97R7Dg/vBcYng0H4mvmWjBqluNE/Fguk9f1psYF/46a stiwbS+WPx5zUrr4OBGJxAwt+d3ejjuOvfNpGWcdM5mzQrmH3R/C2D8IITPulrOcMisx MNh/2k+JQA/hQjjNCQ3eWIls5B1OjzvFRWcK6zJL8OZ0er/DfUCtHREgu/mzw4Ce3/jS Efsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708375291; x=1708980091; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zpq5x1MFUstEbmXxyqU4m42UP4GXxcgE82Vgr2u8pfo=; b=a8f9ai8CdXTvccvlINt/BZFR7VXEH/HRToPOBUA/JsyjJQZPTkCt2Vca7ai4oJwDTm 3xJf4b7ez4Tz2XruYg2YvHui5OLJLCznDe/3m+CXvHl8uA308eNXzAUfbCR5r8zYkfxW 7AoEkyBsVFoTtk97M25TBfBsm15owrhj18ufXwY8sJdBD0WG0kCgNCAmEXYVSvMA6+r3 SyslqDnptoVulR0y6VKUzSlaLI547UblN6UqkfBPqFDAtI5kpYRBUi00sI7xUwMMmLqj 2OgH03L18g5HsTpBH+xAJFwWWxZvYdc4jLtHHKk79RLKZS7HzMmHZAmSJlkM5HFbmNDq 1IDg== X-Gm-Message-State: AOJu0YyVoQsDU04Yu2g/Mwj8q8EBibI/lkE/FG/jbOWBztV1DWF7ZRWD TRavAVpVpl2+GCag6p+g6XEo5w+KBveBqb+sIIlHnpEbBNKs0B0o X-Google-Smtp-Source: AGHT+IH0O6z+6mOIf1MfbIdVpYZYvrlf5UHgfFMl9K5P+FuSV5Xu12L2Tefhx/sTUfTUJUCJn7oA5A== X-Received: by 2002:a05:6000:1f81:b0:33d:2eae:e54e with SMTP id bw1-20020a0560001f8100b0033d2eaee54emr4027418wrb.7.1708375291266; Mon, 19 Feb 2024 12:41:31 -0800 (PST) Received: from lili (roam-nat-fw-prg-194-254-61-41.net.univ-paris-diderot.fr. [194.254.61.41]) by smtp.gmail.com with ESMTPSA id y9-20020a05600c364900b00410c44a39bfsm6109002wmq.1.2024.02.19.12.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 12:41:30 -0800 (PST) From: Simon Tournier In-Reply-To: <87le7ktenv.fsf@gmail.com> References: <0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@gmail.com> <87frxvm7ai.fsf@gmail.com> <87le7ktenv.fsf@gmail.com> Date: Mon, 19 Feb 2024 16:57:28 +0100 Message-ID: <874je45tw7.fsf@gmail.com> 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 5.52 X-Spam-Score: 5.52 X-Migadu-Queue-Id: 26089131EE X-Migadu-Scanner: mx13.migadu.com X-TUID: zYfHcWVeHSfr Hi Maxim, On ven., 16 f=C3=A9vr. 2024 at 14:03, Maxim Cournoyer wrote: > Most of that code also exists in guile-hall, was released in 2023, hence > the copyright year start [0]. I think it would be best something like: --8<---------------cut here---------------start------------->8--- ;;; Copyright =C2=A9 2024 Maxim Cournoyer ;;; ;;; The procedures =E2=80=99define-log-level', =E2=80=99setup-logging=E2=80= =99 and ;;; =E2=80=99shutdown-logging=E2=80=99 are taken from the 'hall/logging.scm= ' file of ;;; Guile-lib (guile-hall). That file has the following copyright ;;; notice: ;;; ;;; Copyright =C2=A9 2023 Maxim Cournoyer ;;; ;;; This file is part of Guix. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but =E2=80=A6 --8<---------------cut here---------------end--------------->8--- > [0] https://gitlab.com/a-sassmannshausen/guile-hall/-/blob/master/hall/l= ogging.scm > >>> +(define-syntax define-log-level >>> + ;; This macro defines a log-level enum type bound to ENUM-NAME for t= he >>> + ;; provided levels. The levels should be specified in increasing or= der of >>> + ;; severity. It also defines 'log-LEVEL' syntax to more convenientl= y log at >>> + ;; LEVEL, with location information. >> >> Why not also a docstring? > > Only procedures can have docstrings, unfortunately. Ah? For instance =E2=80=99define-with-syntax-properties=E2=80=99 or =E2=80= =99define-diagnostic=E2=80=99 or =E2=80=99leave=E2=80=99 from (guix diagnostics); other instance in (gnu = build accounts) or (gnu build secret-service) etc. Do I miss something? >> This make =E2=80=9C--log-level debug=E2=80=9D valid, right? >> >> I think the convention is --long-option[=3DPARAMETER] and that >> --long-option PARAMTER is unconventional. Although I do not find the >> reference. > > It's not as much a convention as a limitation of the SRFI 37 option > parser. GNU getopt, which SRFI 37 aims to emulate, doesn't have such a > limitation, for example. We should improve SRFI 37 to lift such > limitation, in my opinion. I think that=E2=80=99s a bad choice. For two reasons, 1. Let=E2=80=99s keep an uniform across subcommands 2. It potentially opens bug as #50472; no space avoids ambiguous implementations as explained. :-) https://issues.guix.gnu.org/issue/50472 Cheers, simon]