From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id gEkFLH1R22XtwwAAqHPOHw:P1 (envelope-from ) for ; Sun, 25 Feb 2024 15:41:01 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id gEkFLH1R22XtwwAAqHPOHw (envelope-from ) for ; Sun, 25 Feb 2024 15:41:01 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=DPJS8Sws; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708872061; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=c2NCkmS3oCYUUiPo/QuR6C+dQvl4O+xJZ+aQOx8WCs0=; b=uowsaEw0nhazEZ2NMg3FSclcI0rqc69QLN7Cpt5yhILDpk7vrQagP9Ar5eSOxnPwz5TNhK aUo88/MRLS4apXXV5OVsSsi5oqt2jksIzxwzzTI8yN2WDn2UIk3/PfOnwGSkvDGbtM4kVZ bVMlnCE+FVtQcvMqRqHLHAWP7CednDaYxYJ75OHkZp3lNpbQd/AWfSBMdnMtqXaC2P3jUU e4qnGo6kmbk2EzfIXUaVqWDa7FSXLkpTPjlpZVQWGiQQ5nqGcoiVGkGepj/VDpWe3JhhYa lS1hUk7vk4sg5/rr4ChYFZYOWGmKuDKWKdGDyQpNTTTY/47GeDfhaVFtCQpIeQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=DPJS8Sws; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708872061; a=rsa-sha256; cv=none; b=lE0/pexyYVWYqjqflLfeY1sJUbt4PwT53COcvthdQxKzlTHs4ChOdca2O4J/sW4tDZkP14 opS1BDxpN9cJ5MWZohuRvz/c76Yz/G+QtmTu1dJoIqXu8Z5xnq2BcwQL8D1YIhiOLwRTnr UVCyzEOYn/lgtWWk3syiVMvlrn4l5chpdY5WEv11oAnouR3WUfJ0/0ZADeA2VAVPoS3ft2 g6WurTg1zqvACkkrLWj2M+YtlVaWk8GwoA37c67VUzZvww5yUyAZJw9s2h5K1lnKB1iQZ9 evGF0DXTaE8nEWExpdHfUrMM/96GyEqpzOmLvI/6HKBrQZ2MdcW64IBkV6Z8QQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2627C6836C for ; Sun, 25 Feb 2024 15:41:00 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reFgG-0007HG-TD; Sun, 25 Feb 2024 09:40:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reFgF-0007Gy-1p for guix-patches@gnu.org; Sun, 25 Feb 2024 09:40:39 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reFgD-00007b-Sa for guix-patches@gnu.org; Sun, 25 Feb 2024 09:40:38 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1reFgc-0003MJ-93 for guix-patches@gnu.org; Sun, 25 Feb 2024 09:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68946] [PATCH v2] guix: Add logging module. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 25 Feb 2024 14:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68946 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 68946@debbugs.gnu.org, Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Josselin Poiret , Ricardo Wurmus , Christopher Baines Received: via spool by 68946-submit@debbugs.gnu.org id=B68946.170887201912813 (code B ref 68946); Sun, 25 Feb 2024 14:41:02 +0000 Received: (at 68946) by debbugs.gnu.org; 25 Feb 2024 14:40:19 +0000 Received: from localhost ([127.0.0.1]:49267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reFfu-0003Kb-78 for submit@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 ) id 1reFaH-00034k-7S for 68946@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@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 In-Reply-To: <87ttlyaxyq.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 24 Feb 2024 12:44:13 +0100") References: <0b81168e693a21f7fb08bd7677a5cc3120418fc9.1707626620.git.maxim.cournoyer@gmail.com> <87bk8dl8mm.fsf@gnu.org> <87edd4oude.fsf@gmail.com> <87ttlyaxyq.fsf@gnu.org> Date: Sun, 25 Feb 2024 09:32:56 -0500 Message-ID: <87h6hwmx5z.fsf@gmail.com> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -1.81 X-Spam-Score: -1.81 X-Migadu-Queue-Id: 2627C6836C X-TUID: N0Y8O+RKZnPv Hi Ludo, Ludovic Court=C3=A8s writes: > Hi, > > Maxim Cournoyer 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