Received: (at 68946) by debbugs.gnu.org; 22 Aug 2025 13:49:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 22 09:49:21 2025 Received: from localhost ([127.0.0.1]:35783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1upS8v-0004vy-Fl for submit <at> debbugs.gnu.org; Fri, 22 Aug 2025 09:49:21 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:56670) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <zimon.toutoune@HIDDEN>) id 1upS83-0004qj-Hm for 68946 <at> debbugs.gnu.org; Fri, 22 Aug 2025 09:48:28 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3b9dc5c8ee7so1911711f8f.1 for <68946 <at> debbugs.gnu.org>; Fri, 22 Aug 2025 06:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755870501; x=1756475301; 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=X5Kxk7ZovNUnAAhqAokKlXJ4ZU6vxJDeqBEQ+XphPxs=; b=ikLrRzb1Gr8Ht4KiIOYMjs3tJeuwCeabHwu1EtnyFRLAc4nS9q9AlD6BswggCZlXOc Hfc+xrcA9z7LM8z1wSrTucekvH81Uv49mq/m/7gVvBYKvT15Q2bObQ80v2ILNF6sqKwm SOZRRubovkVwn60DrNzYxUnmL4NqNCCNOW27lC/AUxOgNVJng+YtB1Af7wGPlehfXmHv WtQ+g61vuW7OHoRZN58/x8I05T2zeeRRVZYGlKuq1mrVi8XzPcMligxbWRpBkE+08+OW FAMH4EXUmzNOSdUWvXsg+zAwu3oeZqKY4yxbazXvIYGMPy5E1kKQVNs1Dc/QT0ArUmth OBUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755870501; x=1756475301; 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=X5Kxk7ZovNUnAAhqAokKlXJ4ZU6vxJDeqBEQ+XphPxs=; b=Yzd81WySlA1SVgpm+TD/oW2IYZBHYg7YADXfwncxkvtvWeL03qJ47nF75jb7NyOd9E N+RoM4rT4A0xnMoby8x6bSBJi0jFS0Zv/2M0Tg6LhMER4FOgJSX9R5wvggQ5sRVDYIvQ V5elfVJNrwgh1UGZ3rZCJeZzcN+Ucr5n1clBYaQWbp0oEv+H/uMZeRb4iClEpZ1yvRpT jD0nSvsoFyCLBfN7ClQCc4KHJhaZhg+yUEWku1cnvs3CqRBJ0Y+AFYB8aYs1spXRPMzM LrcmC34JgO04Et9bKlnneqoA0kbJhISwPPSN4qiiZ6QBLmjqSjP2clKDjE/EvKP7Ez92 peVg== X-Gm-Message-State: AOJu0Yy7eQnu44USD7abQgheLc7IgYeCbIsTbiYkAizUIdeiH497zrY5 WIQmJCS9aAHYN6yqaxXbZxhH8co8zY23Ty6V1txm6xOy9Pd5OLda6qNGR5ioEg== X-Gm-Gg: ASbGncskLuKRDHdN+3BHx9loAqPZR7yfOmmbvIDgh34cJwBLRorkYa69JD9i9DythdC S1SaoJoDKnz40JgVgV4SeaEjOlRRWYkXyeP2ffkgUWazntOm8tvzGq7xPrq3h7pTOZ7cfwu3nL7 nPnqznPuXXdhM4rv3zP9/dEGbT0lEDpl/yjgb2uq54q31UuM/eAiGeaOP4ycy3sL+B5Mg5F8O5L EW2RIFvVCgO1henqEJPlQ6yjJAG1oXM5o761zLuJtDP3wxNZ9mUCHMsQWZHvD+a2oFCpK8pCwMN i4nlc1+Hr2/me6g6b5uIEe78p2aJIhVKvfezgCYI9H4csmfrx3rKZDjKouok3ejX7L82IxSP+TI AGF7GMI8TzFJe/vLGS+FYe8CUPQxNP3p32SigdHrxaIsB4XbshvBucsBD2AI= X-Google-Smtp-Source: AGHT+IE1cZos9A+KaxzE+CfzAu+WCZ3WMtwbkFONQ/PWeg1Fz2gdc2LjpMMgNdLZPFnix75Od/YCgQ== X-Received: by 2002:a05:6000:18ad:b0:3b8:fb31:a42d with SMTP id ffacd0b85a97d-3c5dc6385e1mr2012153f8f.34.1755870499438; Fri, 22 Aug 2025 06:48:19 -0700 (PDT) Received: from lili (nat-dsi-209.net.univ-paris-diderot.fr. [81.194.30.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b50e2f0adsm37077925e9.13.2025.08.22.06.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Aug 2025 06:48:18 -0700 (PDT) From: Simon Tournier <zimon.toutoune@HIDDEN> To: Maxim Cournoyer <maxim@HIDDEN>, Steve George <steve@HIDDEN> Subject: Re: [bug#68946] [RFC PATCH 0/1] Add logging capability to Guix In-Reply-To: <87freg7dqp.fsf_-_@HIDDEN> References: <cover.1707192720.git.maxim.cournoyer@HIDDEN> <ZyVBXADhHX77PmeR@dragon2> <87freg7dqp.fsf_-_@HIDDEN> Date: Fri, 22 Aug 2025 14:35:50 +0200 Message-ID: <87cy8nwn2x.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 68946 Cc: 68946 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Maxim, On Mon, 28 Jul 2025 at 20:31, Maxim Cournoyer <maxim@HIDDEN> wrote: > Thanks for returning the ball! I've never heard back from patches sent > to Guile which I relied on in my original implementation (I had used > SRFI-209 enums to implement the log level) [0]. I guess I should try > again now that it's hosted on Codeberg. > > [0] https://www.mail-archive.com/guile-devel%40gnu.org/msg17167.html Feel free to report here how it=E2=80=99s going. :-) Well, I think it could be very nice to add logging features to Guix. Because when dealing with bug reports, the loop to get relevant information is more than often annoying, both end. :-) Cheers, simon
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.Received: (at 68946) by debbugs.gnu.org; 28 Jul 2025 11:32:24 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 28 07:32:24 2025 Received: from localhost ([127.0.0.1]:54806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ugM5g-0004ex-5R for submit <at> debbugs.gnu.org; Mon, 28 Jul 2025 07:32:24 -0400 Received: from mailtransmit04.runbox.com ([2a0c:5a00:149::25]:59714) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <maxim@HIDDEN>) id 1ugM5c-0004eX-8Q for 68946 <at> debbugs.gnu.org; Mon, 28 Jul 2025 07:32:21 -0400 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from <maxim@HIDDEN>) id 1ugM5T-003zNx-6G for 68946 <at> debbugs.gnu.org; Mon, 28 Jul 2025 13:32:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=guixotic.coop; s=selector1; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From; bh=cRS1roIi9L5juzy1RxZt4CKSIo9fr7YfmqUGjsPyE7Y=; b=B95JbHp74m/Y4SaKFfNoXxLtN0 6HqVHd4zTM5naYjkDNBlbuGbeQeA15UB256RfPB+Am2xm7FYJ0kQw9qVk1SlOahuojUpKDl0/FpZ/ LdXFSYMmg+hj5pK8l7B3uuKYQKb87DAURuH2GCMt1FdnE44wjFYF8HrDkpkHHHsOkvB6P1e6vEDUa H67Zkg3+RIp5cEYJCEtp/b0TdsWUJaiCLTVZN09oklYj3/fnpY4XAAfw3WhbKWOfa2YxgVXadGy6R wu4ZqyL4KVTwI6CVj0ZFuBaKvB5urgUwt0v2AEU5E/hVHyyjTrSVcalGE6UUogT8lhQlmU8aZapTc bKI1AwWg==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from <maxim@HIDDEN>) id 1ugM5S-0004dJ-1p for 68946 <at> debbugs.gnu.org; Mon, 28 Jul 2025 13:32:10 +0200 Received: by submission03.runbox with esmtpsa [Authenticated ID (1476852)] (TLS1.2:ECDHE_SECP256R1__RSA_SHA256__AES_256_GCM:256) (Exim 4.93) id 1ugM5K-0033c8-Fi; Mon, 28 Jul 2025 13:32:03 +0200 From: Maxim Cournoyer <maxim@HIDDEN> To: Steve George <steve@HIDDEN> Subject: Re: bug#68946: [RFC PATCH 0/1] Add logging capability to Guix In-Reply-To: <ZyVBXADhHX77PmeR@dragon2> Organization: Guixotic References: <cover.1707192720.git.maxim.cournoyer@HIDDEN> <ZyVBXADhHX77PmeR@dragon2> Date: Mon, 28 Jul 2025 20:31:58 +0900 Message-ID: <87freg7dqp.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 68946 Cc: 68946 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Hi Steve, Steve George <steve@HIDDEN> writes: > Hi, > > Giving this a little nudge. I think the ball was with you Maxim to > send a patch adding some initial logging to see if it becomes > useful. Still happy to do so? Thanks for returning the ball! I've never heard back from patches sent to Guile which I relied on in my original implementation (I had used SRFI-209 enums to implement the log level) [0]. I guess I should try again now that it's hosted on Codeberg. [0] https://www.mail-archive.com/guile-devel%40gnu.org/msg17167.html -- Thanks, Maxim
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.Received: (at 68946) by debbugs.gnu.org; 28 Jul 2025 11:28:21 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 28 07:28:21 2025 Received: from localhost ([127.0.0.1]:54791 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ugM1l-0001Xv-01 for submit <at> debbugs.gnu.org; Mon, 28 Jul 2025 07:28:21 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:50468) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1ugM1h-0001XK-FH for 68946 <at> debbugs.gnu.org; Mon, 28 Jul 2025 07:28:18 -0400 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-b3be5c0eb99so3605897a12.1 for <68946 <at> debbugs.gnu.org>; Mon, 28 Jul 2025 04:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753702091; x=1754306891; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W1EGIj7sJOrV9H9wrpx/aBNMohvDtCgS3H4wouQjkf8=; b=DL/G5aU9v7vaI0N4h6A1Y2gL+04YGLhppa+Jum3HfAREMDlzp5i2VvQunpWtRUlY4t bi8vxd/W8knTGHUy/oD6mFEP27PI6HZRzNgjrRC9L4J4Vmm+eXt3A/zTkXfowQuW/gow NYlH7wGz5Z8/W5CjRyAXBL6EzD6rPuYxwq72TYFZDtDkXykM2N8fOo+J4h86ZH58MsMi 1qg/tVknAUTOTkI63BdYvyqlMEhqeIUi+57QJLFZCoGkAYECyfESV5O2WFcOMiRop3Rn 6weiXbXY2urWKLeodQAooJ85WMlt3DZRiEbge4oRyTdqhZMElT24vxj6FyWsHjMxBeaM zCVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753702091; x=1754306891; h=content-transfer-encoding:mime-version:user-agent: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=W1EGIj7sJOrV9H9wrpx/aBNMohvDtCgS3H4wouQjkf8=; b=hJ8iG9/RM8hxneKph/DCwEgsNHa3ZXCXRfoH73S+IcPVWT5lfqk4r03siGlft3Hk93 auEvynarnBmuc7SjpvYknDybfjxmh3EDMaaeiR1Wh6cv7mipJfWuZ8Tas/MtR+5y/jwQ hAo5iw17CbSXoTyUFgO69vMrmGMt3iiMr6LrVEN+6b/snRBMQkF2CgWz0Xc8Br6e6b+Y AIbKAiOtFdiWX/MfhtuHHegeuhyBrCvRrvZi3o4aG93dznlVR9gKMUX8+Gd20mw7epmt eIstL4302DVqOfjk7PHVHHnF3RbT7ppNAWreokADkAY8mcZ6f0v/F5iNCnF/X2FgDpgD FA6g== X-Forwarded-Encrypted: i=1; AJvYcCVFhekZbfZOvvddIYfdd8Gk3/v/C19dzIcFofhS2uh2oOhGJnTprZh5rA7YvoTHtijypjTwyQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxCue4beyj24ynvpuyGA8KUZWf2dEG/+RDtQbeZXmWshhRg+/2r Jj/xf8HvJapIoGK7G480riivlX0VWJEvDfRoAkgl/fv9CFxWMLFB8Nin X-Gm-Gg: ASbGncu+tyfeC9GrL6B/9G3HY/HF9WdUGMi4T8YS2GmnaG2u5W/OAN1KHO1BgsBqhPO dFPICX/hCePSmRu+MhW1YIf8koRAe2shVNKt8upbeurr/vb7JBGsswEI3R3IolEl9AnFmB+yZp1 gI28bKRAh96127C6m5iJBmWHq5xw45f/1Hug3hp6oJpwNMosVPt5k0SxY0rEQDsaFfY4glYHBau 0nzp2VDTyvW6G5rqS/9o+5a4pd8vf0NiJmsmt6qcQK0U9A//jTdc7S31skep9uQnb6bALpcz0tc eseBOHZZQThRfFvN2sKqJNQUe1Tz395JQZQXVB/BYfM9x3SA5YCBw63QxvHcxWFC1YmiOmYHVaY w2wrf2fDrYqbPHwhJz6uI+rvz X-Google-Smtp-Source: AGHT+IHagmD+PeRuPRO7jWFrNaAfbzYUqO2WQyVayJe+ku+QzOELntLgsndYT1/gToPnffN20ys4+g== X-Received: by 2002:a05:6a21:6d86:b0:22c:fc43:c9f3 with SMTP id adf61e73a8af0-23d70150439mr18575682637.21.1753702090994; Mon, 28 Jul 2025 04:28:10 -0700 (PDT) Received: from terra ([2405:6586:7c0:4400:8c2a:c791:f284:c04b]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-b3f7f58f7ebsm4630796a12.19.2025.07.28.04.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jul 2025 04:28:10 -0700 (PDT) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Simon Tournier <zimon.toutoune@HIDDEN> Subject: Re: bug#68946: [RFC PATCH 0/1] Add logging capability to Guix In-Reply-To: <87iksno39b.fsf@HIDDEN> References: <cover.1707192720.git.maxim.cournoyer@HIDDEN> <0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN> <87bk8dl8mm.fsf@HIDDEN> <87edd4oude.fsf@HIDDEN> <87ttlyaxyq.fsf@HIDDEN> <87iksno39b.fsf@HIDDEN> Date: Mon, 28 Jul 2025 20:28:06 +0900 Message-ID: <87jz3s7dx5.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 68946 Cc: 68946 <at> debbugs.gnu.org, Mathieu Othacehe <othacehe@HIDDEN>, Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Simon, Simon Tournier <zimon.toutoune@HIDDEN> writes: > Hi, > > On Sat, 24 Feb 2024 at 12:44, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote: > >>> I understand the concern, but I think to be able to trace execution >>> easily at run time with a simple `--log-level=3Ddebug' would provide va= lue >>> enough (as a developer aid) to justify it. >> >> Again, I lack imagination; where would you use it today? >> >> I think we should only add this facility once it has at least one user. >> Otherwise people using =E2=80=98--log-level=E2=80=99 would be disappoint= ed. :-) > > I propose a candidate: guix pull. ;-) See: > > toward a plan? (was Re: Reducing "You found a bug" reports) > Simon Tournier <zimon.toutoune@HIDDEN> > Tue, 10 Sep 2024 16:51:09 +0200 > id:87wmjjd0ki.fsf@HIDDEN > https://lists.gnu.org/archive/html/guix-devel/2024-09 > https://yhetil.org/guix/87wmjjd0ki.fsf@HIDDEN Good idea! Another candidate: 'guix refresh' Anytime I want to understand what is going on I need to sprinkle tens of peeks (pk), which is not fun nor efficient. E.g., just right now, I was curious to know more about what it did try: guix refresh: warning: updater failed to determine available releases for pharo If I visit https://files.pharo.org/vm/pharo-spur64-headless/Linux-x86_64/source/ it seems it should be able to infer something. --=20 Thanks, Maxim
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at 68946) by debbugs.gnu.org; 16 Nov 2024 10:59:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 16 05:59:25 2024
Received: from localhost ([127.0.0.1]:52242 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1tCGWT-0004Jm-9S
for submit <at> debbugs.gnu.org; Sat, 16 Nov 2024 05:59:25 -0500
Received: from mail-pg1-f173.google.com ([209.85.215.173]:60798)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <zimon.toutoune@HIDDEN>) id 1tCGWR-0004JP-Kh
for 68946 <at> debbugs.gnu.org; Sat, 16 Nov 2024 05:59:24 -0500
Received: by mail-pg1-f173.google.com with SMTP id
41be03b00d2f7-7f45ab88e7fso2037475a12.1
for <68946 <at> debbugs.gnu.org>; Sat, 16 Nov 2024 02:59:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1731754698; x=1732359498; 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=Hczylb3rY/YC8EQ8AgJRyACMjJtXTMtGktk0+ueNRsg=;
b=liP0HMx06lsRrT5Yb+opfKfdXWjLYiKEAovJqn6QvivOtiD+pMwA/SBERxpHoHRD9x
AdfkUXAdph9OuC7TgkQxaV9kfEHjL1aTBFr7cKn9EuM0/qR+IJK0UjOlqrmAeQ+1vbWP
KMsVRS9V43LjN80kMBm4ZzOCit2ouo/P4/E2fcQOQY59nAWGUTtPad/Of2vj/sE2skOc
riIYa/CgnCsEbRMJL2OfacphUtmNwPgm1R9r1T6pD8nOjrFyoyD/V9SkIJ+cnN2Ho4xl
2NHLBcl/SjuS3cFgQOQdXIq4QLtXIblafLRqoxPIZRq9msJBqvF4RZdLHBbP5Xai0WRE
nYFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1731754698; x=1732359498;
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=Hczylb3rY/YC8EQ8AgJRyACMjJtXTMtGktk0+ueNRsg=;
b=gzTctblg/dXYiHO4eGra2GZHtV79M/3FWdU04nJKomW/wyaGX00WwTVj3cRuF+C06s
QHOYLAXyjyvybL3MVSmkycFDj7mGezAyCpxGRRq7awwpzG41FFfxgYTBabo2aYeI8Xo/
QvBXuZbL5I+oXzcDSmZvXYmoiGJc9C6KtmDL2YGMv5P/LpY+20YxX5KwA8gQCx9RgCfA
tUQr1Yy4LOIZaq0aag5U9JTqYB0oZ+mAaV5Q5r9tkQYzs0ps0c7e2QnYp3zIO6lD4Ndm
D8fZZBAxtHlWiXf0HJt9q2FY+8f00ukcZiXUkhxqBo1AQTrQRQSouw5Y2RA8l381lGm+
9Ydw==
X-Gm-Message-State: AOJu0Yzd8ppgmlfHRojserbimQ8pT8IttUiVtA2DZImit04dq3uBCl1y
9INhP8Pmua0UCRM+DBM3haG+jhtJyliyltAyF8EyenTTK1EMK4n8
X-Google-Smtp-Source: AGHT+IENIfnnptNHAWMOlfIkbJzw7k5u8Z7RXp8JctrTeC7Fb53fufedT83Gey5CPsTt1M7OnG1HlQ==
X-Received: by 2002:a17:902:f547:b0:20c:e2ff:4a50 with SMTP id
d9443c01a7336-211d0d6284bmr78836765ad.9.1731754697899;
Sat, 16 Nov 2024 02:58:17 -0800 (PST)
Received: from lili ([147.127.248.1]) by smtp.gmail.com with ESMTPSA id
d9443c01a7336-211d0ec7a88sm25693555ad.80.2024.11.16.02.58.11
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 16 Nov 2024 02:58:17 -0800 (PST)
From: Simon Tournier <zimon.toutoune@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Maxim Cournoyer
<maxim.cournoyer@HIDDEN>
Subject: Re: [bug#68946] [PATCH v2] guix: Add logging module.
In-Reply-To: <87ttlyaxyq.fsf@HIDDEN>
References: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
<0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN>
<87bk8dl8mm.fsf@HIDDEN> <87edd4oude.fsf@HIDDEN>
<87ttlyaxyq.fsf@HIDDEN>
Date: Sat, 16 Nov 2024 11:57:04 +0100
Message-ID: <87iksno39b.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 68946
Cc: 68946 <at> debbugs.gnu.org, Mathieu Othacehe <othacehe@HIDDEN>,
Tobias Geerinckx-Rice <me@HIDDEN>, Josselin Poiret <dev@HIDDEN>,
Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Hi,
On Sat, 24 Feb 2024 at 12:44, Ludovic Court=C3=A8s <ludo@HIDDEN> wrote:
>> I understand the concern, but I think to be able to trace execution
>> easily at run time with a simple `--log-level=3Ddebug' would provide val=
ue
>> enough (as a developer aid) to justify it.
>
> Again, I lack imagination; where would you use it today?
>
> I think we should only add this facility once it has at least one user.
> Otherwise people using =E2=80=98--log-level=E2=80=99 would be disappointe=
d. :-)
I propose a candidate: guix pull. ;-) See:
toward a plan? (was Re: Reducing "You found a bug" reports)
Simon Tournier <zimon.toutoune@HIDDEN>
Tue, 10 Sep 2024 16:51:09 +0200
id:87wmjjd0ki.fsf@HIDDEN
https://lists.gnu.org/archive/html/guix-devel/2024-09
https://yhetil.org/guix/87wmjjd0ki.fsf@HIDDEN
Cheers,
simon
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.Received: (at 68946) by debbugs.gnu.org; 1 Nov 2024 21:00:51 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 01 17:00:51 2024 Received: from localhost ([127.0.0.1]:51958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1t6ylD-0006gj-Qd for submit <at> debbugs.gnu.org; Fri, 01 Nov 2024 17:00:51 -0400 Received: from mailtransmit05.runbox.com ([185.226.149.38]:35490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <steve@HIDDEN>) id 1t6yl8-0006gb-0B for 68946 <at> debbugs.gnu.org; Fri, 01 Nov 2024 17:00:46 -0400 Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from <steve@HIDDEN>) id 1t6yl1-000Td0-Ks for 68946 <at> debbugs.gnu.org; Fri, 01 Nov 2024 22:00:35 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=futurile.net; s=selector1; h=Content-Type:MIME-Version:Message-ID:Subject: To:From:Date; bh=U2+DpBrQiL9u8aRTiAt6Zca9Btp2l1zQ2PeIy8V//7E=; b=Qf7SkfF4cjPg 3STvJXNaW0ASDPULLrtvKuXjk6Stl5yBmgg3Ce/VZRi2UwUCXxA0N4sXuhrcyNVkyGLem5RNlzXcy NNGgMVSs0CzeHxqdBpR0RfL25g754E4En5ZdSOWsKuueRiNf8fQqH9TpuKrpvdi6msJ/tq2PifMg7 aCtLGfCzGLRzMedSPBmukZkHrYriIj8rJNGuenxVNXuE8U8+28xIgHA4RVcfu/cImzBVC/JMx14i7 fhmWW0fWqy4OqQDOxqqfnSwRd8C9q7oHcS6UM3je6AjFyZ/1SwnHOjiA/8ygdij78eOrusHu2mXnS 06Sw8CaVaYwx8PbknzEWEg==; Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from <steve@HIDDEN>) id 1t6yl0-00034a-HG for 68946 <at> debbugs.gnu.org; Fri, 01 Nov 2024 22:00:34 +0100 Received: by submission01.runbox with esmtpsa [Authenticated ID (641962)] (TLS1.2:ECDHE_SECP256R1__RSA_SHA256__AES_256_GCM:256) (Exim 4.93) id 1t6ykf-006H9a-D2 for 68946 <at> debbugs.gnu.org; Fri, 01 Nov 2024 22:00:13 +0100 Date: Fri, 1 Nov 2024 21:00:12 +0000 From: Steve George <steve@HIDDEN> To: 68946 <at> debbugs.gnu.org Subject: RE: Add logging capability to Guix Message-ID: <ZyVBXADhHX77PmeR@dragon2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 68946 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, Giving this a little nudge. I think the ball was with you Maxim to send a patch adding some initial logging to see if it becomes useful. Still happy to do so? Steve / Futurile
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at 68946) by debbugs.gnu.org; 25 Feb 2024 14:40:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 25 09:40:18 2024
Received: from localhost ([127.0.0.1]:49267 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1reFfu-0003Kb-78
for submit <at> debbugs.gnu.org; Sun, 25 Feb 2024 09:40:18 -0500
Received: from mail-oi1-f176.google.com ([209.85.167.176]:44206)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <maxim.cournoyer@HIDDEN>) id 1reFaH-00034k-7S
for 68946 <at> debbugs.gnu.org; Sun, 25 Feb 2024 09:34:30 -0500
Received: by mail-oi1-f176.google.com with SMTP id
5614622812f47-3c199237eaeso782577b6e.0
for <68946 <at> debbugs.gnu.org>; Sun, 25 Feb 2024 06:34:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1708871579; x=1709476379; darn=debbugs.gnu.org;
h=content-transfer-encoding:mime-version:user-agent:message-id:date
:references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to;
bh=c2NCkmS3oCYUUiPo/QuR6C+dQvl4O+xJZ+aQOx8WCs0=;
b=DPJS8Sws/hp6hN9YmX0LSw8+ecSC4ZYb0DCQrN+ufKdNI3wkebLgsWM/caNm0hojFP
mkGBIOs6ckgMKz3yjcYK3/JgS2j0ACjZiFNvm9swMrDTtAaHPXPgFsxcGia/bvDRBoZx
8byFtAaqbPfvqasIkftGdJ3+YoHMHdHyLo/cGLxaUHdFo3Pp7OMHC/GO3XlyuqNpMux4
DjT+Kc7gIs/k7ZF6e3LgNjrgLWhfwUD4oGIi6yswfQ+GkIxbnzirXdankfq55E/5QGnI
ZrcJ8slRPj7uv2XOips+giIxJwvepQdYQfId++62Tsz4Wc7iRfFcVqqFyvC4yyFnwln7
v88Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1708871579; x=1709476379;
h=content-transfer-encoding:mime-version:user-agent: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=c2NCkmS3oCYUUiPo/QuR6C+dQvl4O+xJZ+aQOx8WCs0=;
b=Dl7TYKu+zocSqiQiuTn9aKn5SwRXN3EdsGuEq3vueSaPVEgjC7F0TVW1QIIqiBv3Jb
p88MqPxx64Rs8XbFry4BQaGPvo5gO/fGdSwz0QpDvp7S9fmMwq7zjNE0wJy6xWpy0w93
p0yT52JV/HA8Qf3B3CbrY3CNBN4nFxvC+Eg7q8JQC+9DDLyADPsAtptLA9UapD7cOESv
7ZzBd338qnMvMQPE72LGGOlPbYo5L3Pf3vwKxHG3gK9/4kw+EXJYXeHWnKvUU+Zv/bKc
uVxV50N1RD9nuVknHVSnoEvnegw6L7prGF3ZEJTjYuJ/ViyAh6KY7kXGrk07kRJG+7zP
zGKw==
X-Gm-Message-State: AOJu0YzMEIKoida2wa4wlDW93mnKbkFAVCqL5FDvy4dREkfSg9pIKC1X
eOJjEs3NfC1/yFBEXXGgdHuWwk9wTU1XLw/DR2eoEunK5PwWLiTL
X-Google-Smtp-Source: AGHT+IEi9XeLibTtdBm3MydvJrc+NFR3mDyMUNjEldhyI95ej235eqgMT5BSe106ZF9YBawAHyoaIQ==
X-Received: by 2002:aca:2108:0:b0:3c1:5d20:179b with SMTP id
8-20020aca2108000000b003c15d20179bmr5141095oiz.9.1708871578818;
Sun, 25 Feb 2024 06:32:58 -0800 (PST)
Received: from hurd (dsl-141-6.b2b2c.ca. [66.158.141.6])
by smtp.gmail.com with ESMTPSA id
z18-20020a0ce612000000b0068ee3a50585sm1819565qvm.38.2024.02.25.06.32.57
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 25 Feb 2024 06:32:58 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#68946] [PATCH v2] guix: Add logging module.
In-Reply-To: <87ttlyaxyq.fsf@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?=
=?utf-8?Q?s?= message of "Sat, 24 Feb 2024 12:44:13 +0100")
References: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
<0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN>
<87bk8dl8mm.fsf@HIDDEN> <87edd4oude.fsf@HIDDEN>
<87ttlyaxyq.fsf@HIDDEN>
Date: Sun, 25 Feb 2024 09:32:56 -0500
Message-ID: <87h6hwmx5z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68946
Cc: 68946 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>,
Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>,
Josselin Poiret <dev@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
Hi Ludo,
Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:
>
>>> My concern with logging is that it=E2=80=99s not a good fit for the fun=
ctional
>>> parts (unless it has a functional interface like =E2=80=98pk=E2=80=99, =
but that=E2=80=99s still
>>> sorta =E2=80=9Ccluttering=E2=80=9D otherwise functional code), and I=E2=
=80=99m not sure which
>>> imperative part it could be used for (I don=E2=80=99t doubt there=E2=80=
=99s such a
>>> thing, but I lack imagination).
>>
>> I understand the concern, but I think to be able to trace execution
>> easily at run time with a simple `--log-level=3Ddebug' would provide val=
ue
>> enough (as a developer aid) to justify it.
>
> Again, I lack imagination; where would you use it today?
>
> I think we should only add this facility once it has at least one user.
> Otherwise people using =E2=80=98--log-level=E2=80=99 would be disappointe=
d. :-)
OK; I've added some basic logging to get the ball rolling; it's
currently limited to showing the parsed arguments used with the guix
command run, it looks like so:
--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix --log-level=3Ddebug build hello
2024-02-25 02:58:13 guix/logging.scm:92:5: (run-guix-command) DEBUG: loggin=
g initialized
2024-02-25 02:58:13 guix/ui.scm:2296:11: (run-guix-command) INFO: running g=
uix command `build' with args: (hello)
2024-02-25 02:58:13 guix/scripts/build.scm:741:3: (guix-build) INFO: 'guix =
build' parsed options: ((argument . hello) (build-mode . 0) (graft? . #t) (=
substitutes? . #t) (offload? . #t) (print-build-trace? . #t) (print-extende=
d-build-trace? . #t) (multiplexed-build-output? . #t) (verbosity . 3) (debu=
g . 0))
/gnu/store/kf9cgiq5a2bbxf89h72scl6b5f4jmjpf-hello-2.12.1
--8<---------------cut here---------------end--------------->8---
While this is not super useful yet, we can see where execution started,
and which options were passed to the lower level command API, which
could be a helpful entry-point discoverability hint to a new hacker
wanting to add a switch or look into how a particular command is implemente=
d.
I'll send a v3 with it soon.
--=20
Thanks,
Maxim
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.Received: (at 68946) by debbugs.gnu.org; 24 Feb 2024 11:55:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 24 06:55:16 2024 Received: from localhost ([127.0.0.1]:50524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rdqcd-0008TD-5P for submit <at> debbugs.gnu.org; Sat, 24 Feb 2024 06:55:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1rdqST-0007wp-QB for 68946 <at> debbugs.gnu.org; Sat, 24 Feb 2024 06:44:47 -0500 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 <ludo@HIDDEN>) id 1rdqS0-00005O-0U; Sat, 24 Feb 2024 06:44:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=IgVXhzR8uR93ROuNImdpEm6igjl8PSXH44Mt7p7J3sU=; b=f+0Njw4ApXk2d7YPdffY 6+tkfg3Pc+huVTVOwCTIa1QJSoDk2u1dQoCQ2yNZ3+OQ9h8bSKIHVZwUX7WHBstGqq4fdHvQF7bcE 4BZtuGFwDLJA7c0vuy1tbijRFt6dEDXnho5a3Xd6NrYNkdvn8+OHgG9fzu+fhZwC9f9FAMrB0fcMs P/QWYxYUKxOdfhG+624VYP78Pl0ELpie7u61Ki8gN2dE/7QZdw4i1AY/NVNf/w9ArOp0mGHXQNiQp OVXiyGHlPPq80yE9vL6P3JXH66Tb8H6Zgf0YgeuJtPpVTDfb4hfXDoZtMEGhZOZSA31i/HvF88bD/ wT+6ONG+7tEg8A==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: [bug#68946] [PATCH v2] guix: Add logging module. In-Reply-To: <87edd4oude.fsf@HIDDEN> (Maxim Cournoyer's message of "Thu, 22 Feb 2024 20:13:33 -0500") References: <cover.1707192720.git.maxim.cournoyer@HIDDEN> <0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN> <87bk8dl8mm.fsf@HIDDEN> <87edd4oude.fsf@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 6 =?utf-8?Q?Vent=C3=B4se?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de l'Asaret X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 24 Feb 2024 12:44:13 +0100 Message-ID: <87ttlyaxyq.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 68946 Cc: 68946 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: >> My concern with logging is that it=E2=80=99s not a good fit for the func= tional >> parts (unless it has a functional interface like =E2=80=98pk=E2=80=99, b= ut that=E2=80=99s still >> sorta =E2=80=9Ccluttering=E2=80=9D otherwise functional code), and I=E2= =80=99m not sure which >> imperative part it could be used for (I don=E2=80=99t doubt there=E2=80= =99s such a >> thing, but I lack imagination). > > I understand the concern, but I think to be able to trace execution > easily at run time with a simple `--log-level=3Ddebug' would provide value > enough (as a developer aid) to justify it. Again, I lack imagination; where would you use it today? I think we should only add this facility once it has at least one user. Otherwise people using =E2=80=98--log-level=E2=80=99 would be disappointed.= :-) Ludo=E2=80=99.
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at 68946) by debbugs.gnu.org; 23 Feb 2024 01:25:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 22 20:25:17 2024
Received: from localhost ([127.0.0.1]:48945 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1rdKJQ-0000ez-Sw
for submit <at> debbugs.gnu.org; Thu, 22 Feb 2024 20:25:17 -0500
Received: from mail-qv1-f41.google.com ([209.85.219.41]:55428)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <maxim.cournoyer@HIDDEN>) id 1rdK9Z-0000CY-Qj
for 68946 <at> debbugs.gnu.org; Thu, 22 Feb 2024 20:15:06 -0500
Received: by mail-qv1-f41.google.com with SMTP id
6a1803df08f44-68f78705798so2167266d6.2
for <68946 <at> debbugs.gnu.org>; Thu, 22 Feb 2024 17:14:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1708650817; x=1709255617; darn=debbugs.gnu.org;
h=content-transfer-encoding:mime-version:user-agent:message-id:date
:references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to;
bh=unRv5b0l9sL98H1bbtelU3lQibqt1XN63eTPjfQM0Co=;
b=d9c8sVyN/muWspL60czRTEksS26Hou0Isnk8uMS8oeJfUuOcSyuU9A1Zu8mwNH1NNW
sZLhc4oVNmw3Et0XMBctXRty3RNSzFNf3K6qKi7BFXasqLTPNRs6d3BNqmhV8mYz/vuF
VIOXDk+jmDekoeBz4zLvl0EbnQWTUgT0AfH3JUDX8tISk/vbEk1FBIiKbrWr09ZMlGFg
kkbNr5rurXQIi9cA9FaUqqPIhF9Af0fLaI5pYpjqD2jAVD6ji3c3YKv8KNMq0SLXGjfv
V9VK7r42tCzmIOsOM76RDr3expE87EzSTT+6pMT8mVjmx/W4OFwyl22hb2RWeVQPjyU3
UCCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1708650817; x=1709255617;
h=content-transfer-encoding:mime-version:user-agent: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=unRv5b0l9sL98H1bbtelU3lQibqt1XN63eTPjfQM0Co=;
b=NpY+GFQrhWhr5jOGFDF6U05MBTTrnbBOJ8PJZoJlxgwt8jAPHUbNVKbs+lZtIO1+uD
NjtV00KB+CFX4TQj2RSaIUjfDTO3HXR4TQkb5twagpOPgUjQzAjfctASbRMlmnr8dRyq
Ggxr6OmS3GYPFASMOELIXMBJ7fgVA91dRgXCUeBzfUzQlOeSxY/Jpi4GSKMH/COa1c+D
AyLYPh30+RwMfvtJSERTvqauJLkT//hW+0x8uCosRs9PsvLSVSzKiOJc73EBVPFVMCDL
koglV8OQ7pQic3xRTCAK353u++kWYpMyORgdACSydpt1eYZP3H1msc6XS7SfBKyXeumO
JeYw==
X-Gm-Message-State: AOJu0YwPO+CJ91r43BoEiBzEhYQh+qwW4hMtDvFVGFhm3AwVtZk+LgsR
HN4ZKiXMC5xx+bPc0YVndwrCwDBMxSKVqt2ajvQVpUqGRfMMcjBg
X-Google-Smtp-Source: AGHT+IFTG+L83IXZ+RhLw4xl3mOd05hRo5VcqCLf5S1UqNY8wguT2dPwbhD5JamSNfLIYsuJCys+LA==
X-Received: by 2002:a0c:f3c4:0:b0:68f:5bde:b4a5 with SMTP id
f4-20020a0cf3c4000000b0068f5bdeb4a5mr903214qvm.23.1708650816856;
Thu, 22 Feb 2024 17:13:36 -0800 (PST)
Received: from hurd (dsl-155-144.b2b2c.ca. [66.158.155.144])
by smtp.gmail.com with ESMTPSA id
ok23-20020a0562143c9700b0068fbe5a6ff8sm1348044qvb.121.2024.02.22.17.13.34
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 22 Feb 2024 17:13:35 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: [bug#68946] [PATCH v2] guix: Add logging module.
In-Reply-To: <87bk8dl8mm.fsf@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?=
=?utf-8?Q?s?= message of "Sun, 18 Feb 2024 23:17:53 +0100")
References: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
<0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN>
<87bk8dl8mm.fsf@HIDDEN>
Date: Thu, 22 Feb 2024 20:13:33 -0500
Message-ID: <87edd4oude.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 68946
Cc: 68946 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>,
Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>,
Josselin Poiret <dev@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.9 (--)
Hi Ludovic,
Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
> Hi!
>
> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:
>
>> * configure.ac: Require Guile-Lib.
>> * guix/logging.scm: New module.
>> * Makefile.am (MODULES): Register it.
>> * guix/ui.scm (show-guix-help): Document --log-level global option.
>> (%log-level): New parameter.
>> (run-guix-command): Init logging.
>> (run-guix): Parse new --log-level option.
>>
>> Change-Id: I5026a0d62119615fec3cd0131309f9bcc346a7e9
>
> Two quick notes: I think it=E2=80=99s be best to avoid depending on Guile=
-Lib
> =E2=80=9Cjust=E2=80=9D for this (it=E2=80=99s not clear to me what it=E2=
=80=99s maintenance status is),
> and it=E2=80=99d be great to have concrete use case.
David Pirotte is doing great for Guile-Lib maintenance. It's better
maintained, than say, Guile-Git, which we also depend on :-). It has a
good test suite and is small. We already depend on it for a couple of
our updaters, for its htmlprag HTML parser, so combined with this log
facility, that seems enough to justify hard depending on it.
> My concern with logging is that it=E2=80=99s not a good fit for the funct=
ional
> parts (unless it has a functional interface like =E2=80=98pk=E2=80=99, bu=
t that=E2=80=99s still
> sorta =E2=80=9Ccluttering=E2=80=9D otherwise functional code), and I=E2=
=80=99m not sure which
> imperative part it could be used for (I don=E2=80=99t doubt there=E2=80=
=99s such a
> thing, but I lack imagination).
I understand the concern, but I think to be able to trace execution
easily at run time with a simple `--log-level=3Ddebug' would provide value
enough (as a developer aid) to justify it.
--=20
Thanks,
Maxim
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at 68946) by debbugs.gnu.org; 19 Feb 2024 20:43:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 19 15:43:07 2024
Received: from localhost ([127.0.0.1]:43558 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1rcATi-0001H8-P7
for submit <at> 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 <zimon.toutoune@HIDDEN>) id 1rcATa-0001G4-Lu
for 68946 <at> 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 <at> 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 <zimon.toutoune@HIDDEN>
To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Subject: Re: [bug#68946] [PATCH v2] guix: Add logging module.
In-Reply-To: <87le7ktenv.fsf@HIDDEN>
References: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
<0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN>
<87frxvm7ai.fsf@HIDDEN> <87le7ktenv.fsf@HIDDEN>
Date: Mon, 19 Feb 2024 16:57:28 +0100
Message-ID: <874je45tw7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.3 (/)
X-Debbugs-Envelope-To: 68946
Cc: 68946 <at> debbugs.gnu.org, Mathieu Othacehe <othacehe@HIDDEN>,
Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
Tobias Geerinckx-Rice <me@HIDDEN>, Josselin Poiret <dev@HIDDEN>,
Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)
Hi Maxim,
On ven., 16 f=C3=A9vr. 2024 at 14:03, Maxim Cournoyer <maxim.cournoyer@gmai=
l.com> 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 <maxim.cournoyer@HIDDEN>
;;;
;;; 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 <maxim.cournoyer@HIDDEN>
;;;
;;; 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]
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.Received: (at 68946) by debbugs.gnu.org; 18 Feb 2024 22:20:37 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 18 17:20:37 2024 Received: from localhost ([127.0.0.1]:39870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rbpWW-0000GA-KY for submit <at> debbugs.gnu.org; Sun, 18 Feb 2024 17:20:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1rbpWT-0000Fu-0u for 68946 <at> debbugs.gnu.org; Sun, 18 Feb 2024 17:20:35 -0500 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 <ludo@HIDDEN>) id 1rbpTv-0002Zf-PX; Sun, 18 Feb 2024 17:17:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=OkUSHiEHHVcRWAHrQkbEufgV4pZZqRWcdzoDEcDagcM=; b=jsPYKuUgze5pocBPdWGy b70XGyaCenx0aWxeOrSlxjq8PAk1bwA+CADm05jSNk7CPtdsZlcN+fNqDskBHWIEnn+2O9jCe8MHp JphjxgQDfUPA1fOjKw+knTSBykHUNVOMEyO/UVCrxbM5EznpbozTRbmBeLSnZT+IUX706V1Bd3gVq 04Rlcq/6unKtjgDDJN7WxRYOnxtFZBvqwZVq+ST2xkDMzbgCL+OxzscogRjkDzvOdyHq8EriTsPJa +yvTDrjd17VAa8Gk5dzFCGUrdutZqdB8reJWNhuIZpJGCQcdtSB9uXHDCDEcp5y2mg40DTDlwYDEN 0aAU/ADOZGP9Bw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: [bug#68946] [PATCH v2] guix: Add logging module. In-Reply-To: <0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN> (Maxim Cournoyer's message of "Sat, 10 Feb 2024 23:43:41 -0500") References: <cover.1707192720.git.maxim.cournoyer@HIDDEN> <0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: =?utf-8?Q?D=C3=A9cadi?= 30 =?utf-8?Q?Pluvi=C3=B4se?= an 232 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du =?utf-8?Q?Tra=C3=AEneau?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 18 Feb 2024 23:17:53 +0100 Message-ID: <87bk8dl8mm.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 68946 Cc: 68946 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -5.2 (-----) Hi! Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > * configure.ac: Require Guile-Lib. > * guix/logging.scm: New module. > * Makefile.am (MODULES): Register it. > * guix/ui.scm (show-guix-help): Document --log-level global option. > (%log-level): New parameter. > (run-guix-command): Init logging. > (run-guix): Parse new --log-level option. > > Change-Id: I5026a0d62119615fec3cd0131309f9bcc346a7e9 Two quick notes: I think it=E2=80=99s be best to avoid depending on Guile-L= ib =E2=80=9Cjust=E2=80=9D for this (it=E2=80=99s not clear to me what it=E2=80= =99s maintenance status is), and it=E2=80=99d be great to have concrete use case. My concern with logging is that it=E2=80=99s not a good fit for the functio= nal parts (unless it has a functional interface like =E2=80=98pk=E2=80=99, but = that=E2=80=99s still sorta =E2=80=9Ccluttering=E2=80=9D otherwise functional code), and I=E2=80= =99m not sure which imperative part it could be used for (I don=E2=80=99t doubt there=E2=80=99s= such a thing, but I lack imagination). Thanks, Ludo=E2=80=99.
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at 68946) by debbugs.gnu.org; 16 Feb 2024 19:05:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 16 14:05:03 2024
Received: from localhost ([127.0.0.1]:60206 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1rb3WB-0004SJ-0w
for submit <at> debbugs.gnu.org; Fri, 16 Feb 2024 14:05:03 -0500
Received: from mail-qv1-f43.google.com ([209.85.219.43]:57658)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <maxim.cournoyer@HIDDEN>) id 1rb3W7-0004Rl-GQ
for 68946 <at> debbugs.gnu.org; Fri, 16 Feb 2024 14:05:00 -0500
Received: by mail-qv1-f43.google.com with SMTP id
6a1803df08f44-68f3dc95d3bso2873926d6.3
for <68946 <at> debbugs.gnu.org>; Fri, 16 Feb 2024 11:04:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1708110214; x=1708715014; darn=debbugs.gnu.org;
h=content-transfer-encoding:mime-version:user-agent:message-id:date
:references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to;
bh=mhH//tyO9r5A47AeqgO4ilM3l83zmKcwZF8w2pqwyJM=;
b=eMHbzIR1RDWibMT5NOs35ipNkPAvkkx055AusZPpfRjI3owF1GS5b/bVLfYyxiv1bH
4hBwVw31TyhFK6g42RKBKHvxknfrIxtk/I1CUPhEmpIjqlEKJcMqXmc6XcMPcsQ2uUCF
AwTN7DygiMZ8Sgq5r7WbRd3miL71lz/oBsgDLHgOiR59UrKz2nN4r+BvM/zVg0PsqERK
vXqbHqwyrDLrSLyNf8+7N7Kg24t9OjLIWjo8ZdHvd6jE76YoKDrUaGpMlpOaNKgvVdAi
wiuWBJMuHZca9LKTZv+dGIUNIHTdZ1+oHaawN3OWk+z3q59ksR+CQwNBvlhBUDyRALZV
PhtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1708110214; x=1708715014;
h=content-transfer-encoding:mime-version:user-agent: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=mhH//tyO9r5A47AeqgO4ilM3l83zmKcwZF8w2pqwyJM=;
b=FWe6spSZAdugJ9DjbCkfwkFo0WPK529LIGGT9G9odvUTEkT/GVVrAA0MgJ1Iu82Qwx
Kfjv4gbWaneFLm72tfmrEIEI0PDGEYsbBtFVc4+uKQpPmgk4WA+AHDJoPnP8jDgA3caS
+lZf6fPXYl7R1RKVg08VMFYZqEHOqQ0/lCk8/KKrA67/glwY414XpyT/iZovHMFdJcKP
9dDBr2ueZdTeEwS7sAMmQQa4mP9ltErh4Vy0F4iPn+UTh1weyG/zfrGLVAqgto5ZOQRy
MiKlU//F0JEwgcNtJgtZSzDnwIBUVkHgPmYuPiweBmZCiXpBDR9HSjZ/sSDWtjzQKeMG
7ooA==
X-Gm-Message-State: AOJu0YzNTsm0+Oo3oaR8gannDcQ8zWGLiD73ILTPSBSMfOR2vZ3D+Q8k
6SRBSsBTtS1KiWZKIwpEQg2vWwigjaS4VgsyYe4mu1mvF2Sc8Kfe
X-Google-Smtp-Source: AGHT+IHvpM5Gm3pHBJ7iv+id20T36ekB/nyqZSkf2DWxg1TW26dHNIXsvrlEEiQESHtsCSeRs6FxWg==
X-Received: by 2002:a05:6214:21ec:b0:68f:160c:fd8a with SMTP id
p12-20020a05621421ec00b0068f160cfd8amr6002679qvj.0.1708110214345;
Fri, 16 Feb 2024 11:03:34 -0800 (PST)
Received: from hurd (dsl-148-13.b2b2c.ca. [66.158.148.13])
by smtp.gmail.com with ESMTPSA id
cr5-20020ad456e5000000b0068f0307160bsm182938qvb.63.2024.02.16.11.03.33
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Fri, 16 Feb 2024 11:03:33 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Simon Tournier <zimon.toutoune@HIDDEN>
Subject: Re: [bug#68946] [PATCH v2] guix: Add logging module.
In-Reply-To: <87frxvm7ai.fsf@HIDDEN> (Simon Tournier's message of "Wed, 14
Feb 2024 15:47:49 +0100")
References: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
<0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN>
<87frxvm7ai.fsf@HIDDEN>
Date: Fri, 16 Feb 2024 14:03:32 -0500
Message-ID: <87le7ktenv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.9 (/)
X-Debbugs-Envelope-To: 68946
Cc: 68946 <at> debbugs.gnu.org, Mathieu Othacehe <othacehe@HIDDEN>,
Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
Tobias Geerinckx-Rice <me@HIDDEN>, Josselin Poiret <dev@HIDDEN>,
Ricardo Wurmus <rekado@HIDDEN>, Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.9 (--)
Hi Simon,
Simon Tournier <zimon.toutoune@HIDDEN> writes:
> Hi,
>
> On sam., 10 f=C3=A9vr. 2024 at 23:43, Maxim Cournoyer <maxim.cournoyer@gm=
ail.com> wrote:
>> * configure.ac: Require Guile-Lib.
>> * guix/logging.scm: New module.
>> * Makefile.am (MODULES): Register it.
>> * guix/ui.scm (show-guix-help): Document --log-level global option.
>> (%log-level): New parameter.
>> (run-guix-command): Init logging.
>> (run-guix): Parse new --log-level option.
>
> Cool!
>
> How to synchronize this patch with the Guile-Lib counter-part
>
> [Guile-Lib PATCH v3 0/7] Make log-msg accept source properties fo=
r displaying source location
> Maxim Cournoyer <maxim.cournoyer@HIDDEN>
> Thu, 08 Feb 2024 23:50:41 -0500
> id:20240209045150.17210-1-maxim.cournoyer@HIDDEN
>
> ?
I have commit access to guile-lib; I've pinged its maintainer to see if
they have any objection, and otherwise I'll merge it soon.
> Aside, just to be sure to well understand, this introduces the logger
> but it is not used yet, right?
Correct.
>
>> - guix/lint.scm \
>> + guix/lint.scm \
>> + guix/logging.scm \
>
> Well, I assume being the nitpick person here. :-)
>
> The line guix/lint.scm should not change here.
I fixed the number of tabs on the line above as it looked odd in Emacs
:-).
>> +;;; Copyright =C2=A9 2023, 2024 Maxim Cournoyer <maxim.cournoyer@gmail.=
com>
>
> I think what makes the date of the Copyright is something publicly
> declared (published) and not the date when the author started to work on
> it. At least, it is how it works for book in France.
>
> So here the Copyright would be 2024 only, I guess.
Most of that code also exists in guile-hall, was released in 2023, hence
the copyright year start [0].
[0] https://gitlab.com/a-sassmannshausen/guile-hall/-/blob/master/hall/log=
ging.scm
>> +(define-syntax define-log-level
>> + ;; This macro defines a log-level enum type bound to ENUM-NAME for the
>> + ;; provided levels. The levels should be specified in increasing ord=
er of
>> + ;; severity. It also defines 'log-LEVEL' syntax to more conveniently=
log at
>> + ;; LEVEL, with location information.
>
> Why not also a docstring?
Only procedures can have docstrings, unfortunately.
>> + (lambda (x)
>> + (define-syntax-rule (id parts ...)
>> + ;; Assemble PARTS into a raw (unhygienic) identifier.
>> + (datum->syntax x (symbol-append (syntax->datum parts) ...)))
>
>> diff --git a/guix/ui.scm b/guix/ui.scm
>> index 962d291d2e..f5a6966854 100644
>> --- a/guix/ui.scm
>> +++ b/guix/ui.scm
>> @@ -44,6 +44,7 @@ (define-module (guix ui)
>> #:use-module (guix utils)
>> #:use-module (guix store)
>> #:use-module (guix config)
>> + #:use-module (guix logging)
>
> [...]
>
>> + (((? (cut string-prefix? "--log-level=3D" <>) o) args ...)
>> + (parameterize ((%log-level (string->symbol
>> + (second (string-split o #\=3D)))))
>> + (apply run-guix args)))
>> + (("--log-level" level args ...)
>
> 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.
--=20
Thanks,
Maxim
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at 68946) by debbugs.gnu.org; 15 Feb 2024 09:54:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 15 04:54:49 2024
Received: from localhost ([127.0.0.1]:54118 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1raYS6-0002zh-3S
for submit <at> debbugs.gnu.org; Thu, 15 Feb 2024 04:54:49 -0500
Received: from mail-wr1-f51.google.com ([209.85.221.51]:41215)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <zimon.toutoune@HIDDEN>) id 1raYS1-0002z0-LT
for 68946 <at> debbugs.gnu.org; Thu, 15 Feb 2024 04:54:42 -0500
Received: by mail-wr1-f51.google.com with SMTP id
ffacd0b85a97d-33cfc38c203so99940f8f.0
for <68946 <at> debbugs.gnu.org>; Thu, 15 Feb 2024 01:54:22 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1707990797; x=1708595597; 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=ZIpGHA/nonr7E+zTXo9DzkwIE8NLc2FirsGmrV7lLbQ=;
b=QQmLKbudbg5cuhwZlh8ATecChxkry9mxlLpBl+lTOR9kumBha0/4zBYXrkR3yhFTko
A6oxQGIgFvzvJKwR9eebQdG+8cndHjYbfgg4lXgPOrwfaTevWT4desyQN9R8O6CXq+Ai
z/Fiu4FH5jq/H9ZLL5fAVjAee8DUhVvgC/kza89cipchRCV6d24jowv5id9yh7zJS1X6
dKLMkbjlAaqO/cdQ2lxUOlZKYOEbF33zP/4GFhVTSJmJKRymTccN+TVuJSHro2EY2pZM
Co9yg2JNOlHfaturb8p3cEpUVF5DV4mefvrI0dZgwFSz38srnaYcXUtt/f6DP2F4xz5V
RtJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1707990797; x=1708595597;
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=ZIpGHA/nonr7E+zTXo9DzkwIE8NLc2FirsGmrV7lLbQ=;
b=sWLIQzXd1mYxqn9ReTryINLnhGhSYIlR9ds7p1xDJzkqinCaNTo1kXE2pCq6Ey/Obt
YIpBO7z/ceC8uoTYLBIbdpDc7aqmAV7ZlFsuqxaDrSapvKDeeQMulsgSNBoulZdj7aBH
0N735NFiQbnxCTllup29LkSWGLPp5TPi/u0Kp14oUzHMnFPUu7G8SUhOIq4JioVpVppe
XbTfyxUMMgW9so01SjCvlCAIR/hMA3ks+/Iqwr5jYP8aXbtSdDm15rBDlTRrii0miEGk
2X/XUXArBl6KpwtfRYu7B32uxRzm62pgoTynvM6hiGSA23Y6DgUi69RA7Ihzc4Vzvq2y
caHg==
X-Forwarded-Encrypted: i=1;
AJvYcCWTYyrZpmWYLo2H5QOkoWRboIgnCm4kO+COjf2DX3viUCrxoN7vA6fYhOIfHTo7PlcdYmfrq90VTkNQAGusBMIRFVBZ+Xk=
X-Gm-Message-State: AOJu0YwT4igmOVFQN2/PjRr0gxvhHK6bnKHDtSzmKtUMlB8awG23+l0L
pbU6QnVR9r97I3hbDHyfrLNQNestPWX4bslkpnrQ+zxFHSpOyXUK
X-Google-Smtp-Source: AGHT+IH+9I7/+0G+sWbycUN75sYjTyq3/84gNV4I+TwqwGRq/LKNebuofIxvBcCrmn6IRitT4+NVzw==
X-Received: by 2002:a05:600c:3b02:b0:410:e8d0:5575 with SMTP id
m2-20020a05600c3b0200b00410e8d05575mr1023923wms.1.1707990797367;
Thu, 15 Feb 2024 01:53:17 -0800 (PST)
Received: from lili ([2a01:e0a:59b:9120:7d85:9c0b:111:5112])
by smtp.gmail.com with ESMTPSA id
o4-20020a05600c4fc400b00411d0b58056sm1470119wmq.5.2024.02.15.01.53.16
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 15 Feb 2024 01:53:16 -0800 (PST)
From: Simon Tournier <zimon.toutoune@HIDDEN>
To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>, 68946 <at> debbugs.gnu.org
Subject: Re: [bug#68946] [PATCH v2] guix: Add logging module.
In-Reply-To: <0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN>
References: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
<0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN>
Date: Wed, 14 Feb 2024 15:47:49 +0100
Message-ID: <87frxvm7ai.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.1 (/)
X-Debbugs-Envelope-To: 68946
Cc: Josselin Poiret <dev@HIDDEN>,
Maxim Cournoyer <maxim.cournoyer@HIDDEN>,
Mathieu Othacehe <othacehe@HIDDEN>,
Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
Christopher Baines <guix@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)
Hi,
On sam., 10 f=C3=A9vr. 2024 at 23:43, Maxim Cournoyer <maxim.cournoyer@gmai=
l.com> wrote:
> * configure.ac: Require Guile-Lib.
> * guix/logging.scm: New module.
> * Makefile.am (MODULES): Register it.
> * guix/ui.scm (show-guix-help): Document --log-level global option.
> (%log-level): New parameter.
> (run-guix-command): Init logging.
> (run-guix): Parse new --log-level option.
Cool!
How to synchronize this patch with the Guile-Lib counter-part
[Guile-Lib PATCH v3 0/7] Make log-msg accept source properties for =
displaying source location
Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Thu, 08 Feb 2024 23:50:41 -0500
id:20240209045150.17210-1-maxim.cournoyer@HIDDEN
?
Aside, just to be sure to well understand, this introduces the logger
but it is not used yet, right?
> - guix/lint.scm \
> + guix/lint.scm \
> + guix/logging.scm \
Well, I assume being the nitpick person here. :-)
The line guix/lint.scm should not change here.
> +;;; Copyright =C2=A9 2023, 2024 Maxim Cournoyer <maxim.cournoyer@HIDDEN=
om>
I think what makes the date of the Copyright is something publicly
declared (published) and not the date when the author started to work on
it. At least, it is how it works for book in France.
So here the Copyright would be 2024 only, I guess.
> +(define-syntax define-log-level
> + ;; This macro defines a log-level enum type bound to ENUM-NAME for the
> + ;; provided levels. The levels should be specified in increasing orde=
r of
> + ;; severity. It also defines 'log-LEVEL' syntax to more conveniently =
log at
> + ;; LEVEL, with location information.
Why not also a docstring?
> + (lambda (x)
> + (define-syntax-rule (id parts ...)
> + ;; Assemble PARTS into a raw (unhygienic) identifier.
> + (datum->syntax x (symbol-append (syntax->datum parts) ...)))
> diff --git a/guix/ui.scm b/guix/ui.scm
> index 962d291d2e..f5a6966854 100644
> --- a/guix/ui.scm
> +++ b/guix/ui.scm
> @@ -44,6 +44,7 @@ (define-module (guix ui)
> #:use-module (guix utils)
> #:use-module (guix store)
> #:use-module (guix config)
> + #:use-module (guix logging)
[...]
> + (((? (cut string-prefix? "--log-level=3D" <>) o) args ...)
> + (parameterize ((%log-level (string->symbol
> + (second (string-split o #\=3D)))))
> + (apply run-guix args)))
> + (("--log-level" level args ...)
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.
(also -sPARAMTER or -s PARAMETER)
guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at 68946) by debbugs.gnu.org; 11 Feb 2024 04:44:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 10 23:44:29 2024
Received: from localhost ([127.0.0.1]:46304 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1rZ1hd-0000eV-0v
for submit <at> debbugs.gnu.org; Sat, 10 Feb 2024 23:44:29 -0500
Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]:53434)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <maxim.cournoyer@HIDDEN>) id 1rZ1ha-0000eE-Bk
for 68946 <at> debbugs.gnu.org; Sat, 10 Feb 2024 23:44:27 -0500
Received: by mail-qt1-x834.google.com with SMTP id
d75a77b69052e-42c6e2f3aa2so2364811cf.2
for <68946 <at> debbugs.gnu.org>; Sat, 10 Feb 2024 20:44:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1707626644; x=1708231444; darn=debbugs.gnu.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=wBliG3Q3MoYQqQ1pkpO1UwC6PQP6u6/L1xx2yfhK5Cg=;
b=D9OR3mgly4tT2XpUjDKwjIEV6TJTRPLtnt5VLaRJk9aqrJ3TBaCgLPF4wc+VgP7z0t
nrIAjvYDdglE38krryBvtOPK6XCJXj49CfzS4IUkl+zVCTFM9AsvchsuktSNBnd7s2/g
WIPczJnUed1xN5GvKuIXQZG9WqDHy1tYxm5w6JAg0HxKa0yf3/buNN0CCtt0e2eamJcu
5jDZSJxExbVBCwJmHCaFuR3/lQH6JCMAzFbi2D3IqHIFibV1lTy6vy04EOt6TV75/KXZ
zuQzaG8dFLxvgmq42RGRphi4vNJn+k8tWPlROKTcLOlPncJmWoyV8sFB0lWWb0bqKtUz
foAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1707626644; x=1708231444;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=wBliG3Q3MoYQqQ1pkpO1UwC6PQP6u6/L1xx2yfhK5Cg=;
b=FFLPdtU9YSfLi1UPsmRQz4EVGPzilET0PvOlxOSybupSlaPwRyorVWiju0yXEIvPTZ
uGC7rUnPL4kqSUj2rnHLLggCCmWo/DJ4W8UkUdVnbjf3A/zOzyIu3ocRWrpGVdbP9OXA
xZ1LoFJV8pu/ZSeYB9m9k48926DFJ0U25DOW6jaOtXQBgTCuf1YKgVerVH5SI9cfmLF9
nZ6XeuDrLNpR/qIptrdmRtVSMUgMZHXhx3m3jc5CSW0xV+WX18INvym307G6KJPc83Hq
FmFigaUuV4XNMO4jmOmMDSUzC80/uT8pLd6by3iRPsOYNwtoviDoGl0LS6dqN7qzhjAE
CnfA==
X-Gm-Message-State: AOJu0YwP1ojvCSLaXFZCkSvf9wQtLNsJY9o2SlvfIhPRSsP7e+hms68K
LuLfx+Enou0pTFNkTT3hxUgbcdq1LG7sUZvjfXnKvFz9PoAlH3SWBcEmDEIf
X-Google-Smtp-Source: AGHT+IE4a9bQ5xzveoOyT+6LK25QSEKlcDv+Xc4zl74uEyvCtajWori6soW2DE+EYHrG5HFkN97DVg==
X-Received: by 2002:ac8:5c88:0:b0:42c:4826:7f04 with SMTP id
r8-20020ac85c88000000b0042c48267f04mr5603150qta.29.1707626643999;
Sat, 10 Feb 2024 20:44:03 -0800 (PST)
Received: from localhost.localdomain (dsl-205-151-56-177.b2b2c.ca.
[205.151.56.177]) by smtp.gmail.com with ESMTPSA id
g7-20020ac85807000000b0042ab4a129easm2029619qtg.73.2024.02.10.20.44.02
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 10 Feb 2024 20:44:03 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: 68946 <at> debbugs.gnu.org
Subject: [PATCH v2] guix: Add logging module.
Date: Sat, 10 Feb 2024 23:43:41 -0500
Message-ID: <0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68946
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
* configure.ac: Require Guile-Lib.
* guix/logging.scm: New module.
* Makefile.am (MODULES): Register it.
* guix/ui.scm (show-guix-help): Document --log-level global option.
(%log-level): New parameter.
(run-guix-command): Init logging.
(run-guix): Parse new --log-level option.
Change-Id: I5026a0d62119615fec3cd0131309f9bcc346a7e9
---
Changes in v2:
- Honor the GUIX_LOG_LEVEL environment variable
Makefile.am | 5 ++-
configure.ac | 6 +--
guix/logging.scm | 98 ++++++++++++++++++++++++++++++++++++++++++++++++
guix/ui.scm | 19 +++++++++-
4 files changed, 122 insertions(+), 6 deletions(-)
create mode 100644 guix/logging.scm
diff --git a/Makefile.am b/Makefile.am
index cef972880c..6929ee5f69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,7 +14,7 @@
# Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
# Copyright © 2018 Alex Vong <alexvong1995@HIDDEN>
# Copyright © 2019, 2023 Efraim Flashner <efraim@HIDDEN>
-# Copyright © 2020, 2021, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+# Copyright © 2020, 2021, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
# Copyright © 2021 Chris Marusich <cmmarusich@HIDDEN>
# Copyright © 2021 Andrew Tropin <andrew@HIDDEN>
# Copyright © 2023 Clément Lassieur <clement@HIDDEN>
@@ -125,7 +125,8 @@ MODULES = \
guix/substitutes.scm \
guix/upstream.scm \
guix/licenses.scm \
- guix/lint.scm \
+ guix/lint.scm \
+ guix/logging.scm \
guix/glob.scm \
guix/git.scm \
guix/git-authenticate.scm \
diff --git a/configure.ac b/configure.ac
index ecbd596a34..133692c033 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,12 +149,12 @@ if test "x$guix_cv_have_recent_guile_git" != "xyes"; then
AC_MSG_ERROR([A recent Guile-Git could not be found; please install it.])
fi
-dnl Check for the optional Guile-Lib.
+dnl Require Guile-Lib, for logging and HTML parsing.
+GUILE_MODULE_REQUIRED([logging logger])
GUILE_MODULE_EXPORTS([have_guile_lib], [(htmlprag)], [%strict-tokenizer?])
AM_CONDITIONAL([HAVE_GUILE_LIB], [test "x$have_guile_lib" = "xyes"])
AM_COND_IF(HAVE_GUILE_LIB,,
- [AC_MSG_WARN([The Guile-Lib requirement was not satisfied (>= 0.2.7);
-Some features such as the Go importer will not be usable.])])
+ [AC_MSG_ERROR([The Guile-Lib requirement was not satisfied (>= 0.2.7)])])
dnl Check for Guile-zlib.
GUIX_CHECK_GUILE_ZLIB
diff --git a/guix/logging.scm b/guix/logging.scm
new file mode 100644
index 0000000000..913bc9ed3f
--- /dev/null
+++ b/guix/logging.scm
@@ -0,0 +1,98 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2023, 2024 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix logging)
+ #:use-module (logging logger)
+ #:use-module (logging port-log)
+
+ #:use-module (oop goops)
+ #:use-module (srfi srfi-209)
+
+ #:export (setup-logging
+ shutdown-logging
+
+ log-level
+ log-debug
+ log-info
+ log-warning
+ log-error
+ log-critical))
+
+(define-syntax define-log-level
+ ;; This macro defines a log-level enum type bound to ENUM-NAME for the
+ ;; provided levels. The levels should be specified in increasing order of
+ ;; severity. It also defines 'log-LEVEL' syntax to more conveniently log at
+ ;; LEVEL, with location information.
+ (lambda (x)
+ (define-syntax-rule (id parts ...)
+ ;; Assemble PARTS into a raw (unhygienic) identifier.
+ (datum->syntax x (symbol-append (syntax->datum parts) ...)))
+
+ (syntax-case x ()
+ ((_ enum-name (level ...))
+ #`(begin
+ (define enum-name
+ (make-enum-type '(level ...)))
+
+ #,@(map (lambda (lvl)
+ (with-syntax ((log (id 'log- lvl))
+ (lvl lvl))
+ #'(define-syntax log
+ (lambda (y)
+ (syntax-case y ()
+ ((log . args)
+ #`(log-msg
+ '#,(datum->syntax
+ y (syntax-source #'log))
+ 'lvl #,@#'args)))))))
+ #'(level ...)))))))
+
+(define-log-level log-level
+ (debug info warning error critical))
+
+(define* (setup-logging #:key (level 'warning))
+ "Configure and open logger at LEVEL)."
+ (let* ((level-enum (or (enum-name->enum log-level level)
+ (begin
+ (format (current-error-port)
+ "error: invalid log level~%")
+ (exit 1))))
+ (lgr (make <logger>))
+ (console (make <port-log> #:port (current-error-port)))
+ (levels-count (enum-type-size log-level)))
+
+ ;; Register logging handlers.
+ (add-handler! lgr console)
+
+ ;; Configure the log level.
+ (let loop ((enum (enum-min log-level)))
+ (let ((lvl (enum-name enum)))
+ (unless (eq? level lvl)
+ (disable-log-level! lgr lvl)
+ (loop (enum-next enum)))))
+
+ ;; Activate the configured logger.
+ (set-default-logger! lgr)
+ (open-log! lgr)
+ (log-debug "logging initialized")))
+
+(define (shutdown-logging)
+ "Flush and destroy logger."
+ (flush-log)
+ (close-log!)
+ (set-default-logger! #f))
diff --git a/guix/ui.scm b/guix/ui.scm
index 962d291d2e..f5a6966854 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -44,6 +44,7 @@ (define-module (guix ui)
#:use-module (guix utils)
#:use-module (guix store)
#:use-module (guix config)
+ #:use-module (guix logging)
#:use-module (guix packages)
#:use-module (guix profiles)
#:use-module (guix derivations)
@@ -2225,6 +2226,9 @@ (define (show-guix-help)
-h, --help display this helpful text again and exit"))
(display (G_ "
-V, --version display version and copyright information and exit"))
+ (display (G_ "
+ --log-level=LEVEL set the logging verbosity to LEVEL, one of
+ debug, warning, error or critical"))
(newline)
(newline)
@@ -2248,6 +2252,10 @@ (define (show-guix-help)
categories))
(show-bug-report-information))
+(define %log-level (make-parameter (or (and=> (getenv "GUIX_LOG_LEVEL")
+ string->symbol)
+ 'warning)))
+
(define (run-guix-command command . args)
"Run COMMAND with the given ARGS. Report an error when COMMAND is not
found."
@@ -2282,10 +2290,12 @@ (define (run-guix-command command . args)
(symbol-append 'guix- command))))
(parameterize ((program-name command))
(dynamic-wind
- (const #f)
+ (lambda ()
+ (setup-logging #:level (%log-level)))
(lambda ()
(apply command-main args))
(lambda ()
+ (shutdown-logging)
;; Abuse 'exit-hook' (which is normally meant to be used by the
;; REPL) to run things like profiling hooks upon completion.
(run-hook exit-hook))))))
@@ -2311,6 +2321,13 @@ (define (run-guix . args)
(leave-on-EPIPE (show-guix-help)))
((or ("-V") ("--version"))
(show-version-and-exit "guix"))
+ (((? (cut string-prefix? "--log-level=" <>) o) args ...)
+ (parameterize ((%log-level (string->symbol
+ (second (string-split o #\=)))))
+ (apply run-guix args)))
+ (("--log-level" level args ...)
+ (parameterize ((%log-level (string->symbol level)))
+ (apply run-guix args)))
(((? option? o) args ...)
(format (current-error-port)
(G_ "guix: unrecognized option '~a'~%") o)
base-commit: 9edbb2d7a40c9da7583a1046e39b87633459f656
--
2.41.0
guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at submit) by debbugs.gnu.org; 6 Feb 2024 04:17:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 05 23:17:03 2024
Received: from localhost ([127.0.0.1]:53058 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1rXCtL-0006DR-32
for submit <at> debbugs.gnu.org; Mon, 05 Feb 2024 23:17:03 -0500
Received: from lists.gnu.org ([2001:470:142::17]:35880)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <maxim.cournoyer@HIDDEN>) id 1rXCtI-0006Cq-6Y
for submit <at> debbugs.gnu.org; Mon, 05 Feb 2024 23:17:01 -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 <maxim.cournoyer@HIDDEN>)
id 1rXCsy-0004a2-Qq
for guix-patches@HIDDEN; Mon, 05 Feb 2024 23:16:40 -0500
Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from <maxim.cournoyer@HIDDEN>)
id 1rXCsj-0001TU-Du
for guix-patches@HIDDEN; Mon, 05 Feb 2024 23:16:39 -0500
Received: by mail-qv1-xf2b.google.com with SMTP id
6a1803df08f44-68c427136b0so24804196d6.1
for <guix-patches@HIDDEN>; Mon, 05 Feb 2024 20:16:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1707192983; x=1707797783; darn=gnu.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to;
bh=VqUUYpiTVxa7yGta9HZDpfR36tGK9MZHHNeIqi0knaE=;
b=cJpZV1VtJ/dN6VW+Z42mfJNvqgIMaswHDzoixQAXtROx2C8vqqFgQINi10GOZuguBV
TztSspz1GM0CmfQybEsBndTjbSmMsn7ETKP2q7h0CusMV9CE+Enz3cx5GnJ5VD7iCPy0
n7Pzhd1AxThCN3421NWEcjOcm+SRFc8kH/WTd+aEdTyS5yBz8i8MtXJ0uchzktFocpe/
eqQF/srV1HIYP+hWM/cwERYrUNhShzt5wfqvl1/JsKii0Rj9wU3/TGEp7l28KpX2h8bT
HTBU8WdGVpbQOsbbBYNJJw44DfCN1vfzHbMzLsVEorczUUCbaVPPe4MrwSvpEeWzdKK2
hP+w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1707192983; x=1707797783;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=VqUUYpiTVxa7yGta9HZDpfR36tGK9MZHHNeIqi0knaE=;
b=AROsuMel+5yEDrACfotgvWcH1LjV++lahSUGfJOCz7WItVx0WcDPPJo+kCkWRWwrIu
A4f/1u1Od/kRnIPBo1s6nqzLrabe/6F2r1CgYzOZ3zEpxt4BtJrM7Ig9cxGw16gNVmdS
BfPKGdC71TKkxGO0OJlkY492PMmXVRmFx0KkbfgmCCIL3AjIpuqA+FPICFSGEdJsUoDv
/FGHSn6225uGlqHJsztTJFwvoSwS19Pa0ujqyO+jkA8OOh1uaQpSH3bznFJBSx3yGaZM
8kIqdN/muzqoXx8Z5WKIITYt7UJk7FHa92V4KiX2NO2LlN38MZMRTwv3ajwK3DYUhqki
Y52g==
X-Gm-Message-State: AOJu0YyRZgySobsUogROS+6Zj1QWtFskvSxd2IaAz1sUGs4PF7Uzjhuq
nS+p2cd3mwFECQ2QtjUETxAAc3+7CmEr4AHRoshuOojMttlZZyR9A5Rs77Px
X-Google-Smtp-Source: AGHT+IEfzBuiQEnjpeh0SGsocf7ljch9pD7SZEmoE6P6tMhUpYDKVVgYKjjoq6V9wCZrt3fsM2oMeA==
X-Received: by 2002:ad4:594b:0:b0:68c:aa81:4f2 with SMTP id
eo11-20020ad4594b000000b0068caa8104f2mr1442369qvb.13.1707192983533;
Mon, 05 Feb 2024 20:16:23 -0800 (PST)
Received: from localhost.localdomain (dsl-10-130-152.b2b2c.ca. [72.10.130.152])
by smtp.gmail.com with ESMTPSA id
ez4-20020ad45904000000b0068ca41d6c26sm644179qvb.78.2024.02.05.20.16.22
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 05 Feb 2024 20:16:23 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: guix-patches@HIDDEN
Subject: [RFC PATCH 1/1] guix: Add logging module.
Date: Mon, 5 Feb 2024 23:12:01 -0500
Message-ID: <8aa12707e491aa2fc5da48ba3877d368fe5710cf.1707192720.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
References: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::f2b;
envelope-from=maxim.cournoyer@HIDDEN; helo=mail-qv1-xf2b.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01,
T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)
* configure.ac: Require Guile-Lib.
* guix/logging.scm: New module.
* Makefile.am (MODULES): Register it.
* guix/ui.scm (show-guix-help): Document --log-level global option.
(%log-level): New parameter.
(run-guix-command): Init logging.
(run-guix): Parse new --log-level option.
Change-Id: I5026a0d62119615fec3cd0131309f9bcc346a7e9
---
Makefile.am | 5 ++-
configure.ac | 6 +--
guix/logging.scm | 98 ++++++++++++++++++++++++++++++++++++++++++++++++
guix/ui.scm | 17 ++++++++-
4 files changed, 120 insertions(+), 6 deletions(-)
create mode 100644 guix/logging.scm
diff --git a/Makefile.am b/Makefile.am
index cef972880c..6929ee5f69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,7 +14,7 @@
# Copyright © 2018 Oleg Pykhalov <go.wigust@HIDDEN>
# Copyright © 2018 Alex Vong <alexvong1995@HIDDEN>
# Copyright © 2019, 2023 Efraim Flashner <efraim@HIDDEN>
-# Copyright © 2020, 2021, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+# Copyright © 2020, 2021, 2023, 2024 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
# Copyright © 2021 Chris Marusich <cmmarusich@HIDDEN>
# Copyright © 2021 Andrew Tropin <andrew@HIDDEN>
# Copyright © 2023 Clément Lassieur <clement@HIDDEN>
@@ -125,7 +125,8 @@ MODULES = \
guix/substitutes.scm \
guix/upstream.scm \
guix/licenses.scm \
- guix/lint.scm \
+ guix/lint.scm \
+ guix/logging.scm \
guix/glob.scm \
guix/git.scm \
guix/git-authenticate.scm \
diff --git a/configure.ac b/configure.ac
index ecbd596a34..133692c033 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,12 +149,12 @@ if test "x$guix_cv_have_recent_guile_git" != "xyes"; then
AC_MSG_ERROR([A recent Guile-Git could not be found; please install it.])
fi
-dnl Check for the optional Guile-Lib.
+dnl Require Guile-Lib, for logging and HTML parsing.
+GUILE_MODULE_REQUIRED([logging logger])
GUILE_MODULE_EXPORTS([have_guile_lib], [(htmlprag)], [%strict-tokenizer?])
AM_CONDITIONAL([HAVE_GUILE_LIB], [test "x$have_guile_lib" = "xyes"])
AM_COND_IF(HAVE_GUILE_LIB,,
- [AC_MSG_WARN([The Guile-Lib requirement was not satisfied (>= 0.2.7);
-Some features such as the Go importer will not be usable.])])
+ [AC_MSG_ERROR([The Guile-Lib requirement was not satisfied (>= 0.2.7)])])
dnl Check for Guile-zlib.
GUIX_CHECK_GUILE_ZLIB
diff --git a/guix/logging.scm b/guix/logging.scm
new file mode 100644
index 0000000000..913bc9ed3f
--- /dev/null
+++ b/guix/logging.scm
@@ -0,0 +1,98 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2023, 2024 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix logging)
+ #:use-module (logging logger)
+ #:use-module (logging port-log)
+
+ #:use-module (oop goops)
+ #:use-module (srfi srfi-209)
+
+ #:export (setup-logging
+ shutdown-logging
+
+ log-level
+ log-debug
+ log-info
+ log-warning
+ log-error
+ log-critical))
+
+(define-syntax define-log-level
+ ;; This macro defines a log-level enum type bound to ENUM-NAME for the
+ ;; provided levels. The levels should be specified in increasing order of
+ ;; severity. It also defines 'log-LEVEL' syntax to more conveniently log at
+ ;; LEVEL, with location information.
+ (lambda (x)
+ (define-syntax-rule (id parts ...)
+ ;; Assemble PARTS into a raw (unhygienic) identifier.
+ (datum->syntax x (symbol-append (syntax->datum parts) ...)))
+
+ (syntax-case x ()
+ ((_ enum-name (level ...))
+ #`(begin
+ (define enum-name
+ (make-enum-type '(level ...)))
+
+ #,@(map (lambda (lvl)
+ (with-syntax ((log (id 'log- lvl))
+ (lvl lvl))
+ #'(define-syntax log
+ (lambda (y)
+ (syntax-case y ()
+ ((log . args)
+ #`(log-msg
+ '#,(datum->syntax
+ y (syntax-source #'log))
+ 'lvl #,@#'args)))))))
+ #'(level ...)))))))
+
+(define-log-level log-level
+ (debug info warning error critical))
+
+(define* (setup-logging #:key (level 'warning))
+ "Configure and open logger at LEVEL)."
+ (let* ((level-enum (or (enum-name->enum log-level level)
+ (begin
+ (format (current-error-port)
+ "error: invalid log level~%")
+ (exit 1))))
+ (lgr (make <logger>))
+ (console (make <port-log> #:port (current-error-port)))
+ (levels-count (enum-type-size log-level)))
+
+ ;; Register logging handlers.
+ (add-handler! lgr console)
+
+ ;; Configure the log level.
+ (let loop ((enum (enum-min log-level)))
+ (let ((lvl (enum-name enum)))
+ (unless (eq? level lvl)
+ (disable-log-level! lgr lvl)
+ (loop (enum-next enum)))))
+
+ ;; Activate the configured logger.
+ (set-default-logger! lgr)
+ (open-log! lgr)
+ (log-debug "logging initialized")))
+
+(define (shutdown-logging)
+ "Flush and destroy logger."
+ (flush-log)
+ (close-log!)
+ (set-default-logger! #f))
diff --git a/guix/ui.scm b/guix/ui.scm
index 962d291d2e..b42d620a0c 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -44,6 +44,7 @@ (define-module (guix ui)
#:use-module (guix utils)
#:use-module (guix store)
#:use-module (guix config)
+ #:use-module (guix logging)
#:use-module (guix packages)
#:use-module (guix profiles)
#:use-module (guix derivations)
@@ -2225,6 +2226,9 @@ (define (show-guix-help)
-h, --help display this helpful text again and exit"))
(display (G_ "
-V, --version display version and copyright information and exit"))
+ (display (G_ "
+ --log-level=LEVEL set the logging verbosity to LEVEL, one of
+ debug, warning, error or critical"))
(newline)
(newline)
@@ -2248,6 +2252,8 @@ (define (show-guix-help)
categories))
(show-bug-report-information))
+(define %log-level (make-parameter 'warning))
+
(define (run-guix-command command . args)
"Run COMMAND with the given ARGS. Report an error when COMMAND is not
found."
@@ -2282,10 +2288,12 @@ (define (run-guix-command command . args)
(symbol-append 'guix- command))))
(parameterize ((program-name command))
(dynamic-wind
- (const #f)
+ (lambda ()
+ (setup-logging #:level (%log-level)))
(lambda ()
(apply command-main args))
(lambda ()
+ (shutdown-logging)
;; Abuse 'exit-hook' (which is normally meant to be used by the
;; REPL) to run things like profiling hooks upon completion.
(run-hook exit-hook))))))
@@ -2311,6 +2319,13 @@ (define (run-guix . args)
(leave-on-EPIPE (show-guix-help)))
((or ("-V") ("--version"))
(show-version-and-exit "guix"))
+ (((? (cut string-prefix? "--log-level=" <>) o) args ...)
+ (parameterize ((%log-level (string->symbol
+ (second (string-split o #\=)))))
+ (apply run-guix args)))
+ (("--log-level" level args ...)
+ (parameterize ((%log-level (string->symbol level)))
+ (apply run-guix args)))
(((? option? o) args ...)
(format (current-error-port)
(G_ "guix: unrecognized option '~a'~%") o)
--
2.41.0
guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
Received: (at submit) by debbugs.gnu.org; 6 Feb 2024 04:14:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 05 23:14:32 2024
Received: from localhost ([127.0.0.1]:53048 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1rXCqu-00068g-GZ
for submit <at> debbugs.gnu.org; Mon, 05 Feb 2024 23:14:32 -0500
Received: from lists.gnu.org ([2001:470:142::17]:34064)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <maxim.cournoyer@HIDDEN>) id 1rXCqr-00068S-Rn
for submit <at> debbugs.gnu.org; Mon, 05 Feb 2024 23:14:30 -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 <maxim.cournoyer@HIDDEN>)
id 1rXCqZ-0004Dl-H8
for guix-patches@HIDDEN; Mon, 05 Feb 2024 23:14:11 -0500
Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from <maxim.cournoyer@HIDDEN>)
id 1rXCqX-0000z0-TJ
for guix-patches@HIDDEN; Mon, 05 Feb 2024 23:14:11 -0500
Received: by mail-qk1-x735.google.com with SMTP id
af79cd13be357-783d4b3ad96so330473585a.3
for <guix-patches@HIDDEN>; Mon, 05 Feb 2024 20:14:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1707192848; x=1707797648; darn=gnu.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=S4Lge30t8oK7p3S8x7W+mLc1DL2i2Pwogjf5ZIlotp8=;
b=ANDt2L4YPXVG2NLr4vPSBHPYKmDw0UYZENa5vD4XItBJ9Mt2PPxzGCgBko+/Z+i0Or
ZicPBC/Z9HYKdGyBjxDex6o95Zw5btJOUD7VWRCQyI7Muabf6NowNMLePWXHymZ96V0s
RxQtjPEAaHliUu44pS1hfbNPIuFOH4BqzBaT1ALpGKu3156G8oPMzigp/TLgQ6B8SyVt
Fx2a8epUZ7XG3J6AroPlY2UZ0wlAkyfFcn4TfoH448nmnAydpUqInkZ0edsjZl0E15Ng
bGPSlVZaa1in1sYXPTtWo89n1UoWqVp2BFj6cOWJ1m+90jESJuEHqNUuFtrlUVO9D1hR
lUXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1707192848; x=1707797648;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=S4Lge30t8oK7p3S8x7W+mLc1DL2i2Pwogjf5ZIlotp8=;
b=PBM5fVhLIHkyshD3O4ePyca/ZW95uVFbOqvGTQkz64iqdkt9z+mbvJoVl/L3L9tn4d
jf9cbM48G9wRfY9onGu4scdAsWj5R4Vcq87ffWp6RrLptyazTb5+9yaoDG9pzpyUWJSf
edOTQSLLhsahXYHwuoi9HrClrmnQg6+KsJBCcWPzAROqobVTLByN+qintYUcZ2z6RdWt
AeW9yTYqjMvpEKkztMctVAN8atrHSn4W/UGdC6amcqG0UiwNKxnQjBVWMDfo1ATmXP1K
zhsTTN+ykWcmxoUsz/lMVaolvN+xzE1L71YnOaIow+PU9SRvn829gd7HEMCRyLtfxFNJ
zReQ==
X-Gm-Message-State: AOJu0YzorDcqI6jCBQguzpWsvfDun2dEV9CqN7E+bmqqET2N7Vqzw+C8
YK3vsODF/Z4vwGoaKdXVm3RkPAe8fpCr8Qbyen5itztPgXGrDUYmD8uKbG4x
X-Google-Smtp-Source: AGHT+IHvETQvzCRDSkbbY6P+cQpYTukQm+MYqrcN98MVHy8Aqm/2WylpnN0T1hQOgmBeHgoMKOMqRA==
X-Received: by 2002:ad4:5943:0:b0:68c:3de0:8a with SMTP id
eo3-20020ad45943000000b0068c3de0008amr1646244qvb.16.1707192848343;
Mon, 05 Feb 2024 20:14:08 -0800 (PST)
Received: from localhost.localdomain (dsl-10-130-152.b2b2c.ca. [72.10.130.152])
by smtp.gmail.com with ESMTPSA id
ez4-20020ad45904000000b0068ca41d6c26sm644179qvb.78.2024.02.05.20.14.07
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 05 Feb 2024 20:14:07 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: guix-patches@HIDDEN
Subject: [RFC PATCH 0/1] Add logging capability to Guix
Date: Mon, 5 Feb 2024 23:12:00 -0500
Message-ID: <cover.1707192720.git.maxim.cournoyer@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2607:f8b0:4864:20::735;
envelope-from=maxim.cournoyer@HIDDEN; helo=mail-qk1-x735.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)
This adds the ability to simply log messages during execution, whose level can
be selected via a new '--log-level' option.
It relies on pending Guile features (SRFI 209 enums) [0] as well as some
modifications to Guile-Lib's logging library so that it can support source
properties [1]. To test, I symlink the 'guile' binary at the root of the
Guix checkout to my ~/src/guile/meta/guile built binary, and I build Guix with
'make GUILE=./guile', in an environment containing the modified guile-lib:
guix shell --pure -D guix --with-source=guile-lib=/home/maxim/src/guile-lib
Here's some dummy output just to show what the default format looks like:
2024-02-06 03:38:44 guix/derivations.scm:272:16: DEBUG: adding input #<<derivation-input> drv: #<derivation /gnu/store/2ll0ig7jn3w7rqsyfjl358r2q9lga15a-gcc-core-4.6.4.tar.gz.drv => /gnu/store/8fsrfzp53azpsb5n3rbh24n1bcrimzpj-gcc-core-4.6.4.tar.gz 7f60e5ea7af0> sub-derivations: ("out")> to list
2024-02-06 03:38:44 guix/derivations.scm:272:16: DEBUG: adding input #<<derivation-input> drv: #<derivation /gnu/store/5hmjcad7k2z2d8rc38p2jcsh88dvpqr6-gcc-g++-4.6.4.tar.gz.drv => /gnu/store/qbj186qvw9312ki8qqmxc5hx6izwp1km-gcc-g++-4.6.4.tar.gz 7f60e5ea7a00> sub-derivations: ("out")> to list
[0] https://lists.gnu.org/archive/html/guile-devel/2023-12/msg00087.html
[1] https://lists.gnu.org/archive/html/guile-devel/2024-02/msg00000.html
Maxim Cournoyer (1):
guix: Add logging module.
Makefile.am | 5 ++-
configure.ac | 6 +--
guix/logging.scm | 98 ++++++++++++++++++++++++++++++++++++++++++++++++
guix/ui.scm | 17 ++++++++-
4 files changed, 120 insertions(+), 6 deletions(-)
create mode 100644 guix/logging.scm
base-commit: c76004c574acc3291e8d2526fe534719473a87ff
--
2.41.0
Maxim Cournoyer <maxim.cournoyer@HIDDEN>:guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN.
Full text available.guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:bug#68946; Package guix-patches.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.