From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id yJxSIJO2rmVZZQAAe85BDQ:P1 (envelope-from ) for ; Mon, 22 Jan 2024 19:40:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id yJxSIJO2rmVZZQAAe85BDQ (envelope-from ) for ; Mon, 22 Jan 2024 19:40:19 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail header.b=GpjiSXvn; dmarc=pass (policy=none) header.from=lendvai.name; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705948819; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=4cQC0ZgYfBFGu1MBU1YGxNI7R2PK8K0MZdQWBQ530Fg=; b=kc7ilZAunvXKkbwmd97FBXVGERMXt//L5Hs/T/vlOZO59OS3AlXGknOEt6vzJWanc5MjtI Q30VhX60JPqmZNdoV18GBE4L9gVYxBuO+t67a8FrL3h2neCzjJ78iGB5fIMmvsh4CSzyMk Pwe6rX8XvMzQ0UgWQ9j66XCCFB7eZ//YlDmXM0kFreZFd7tE6O83j5M4H9Oem1tJB4SteT NjK6vGztcG3WGwH0fyAjJ53jAUi5Jy+I9rp2I61hCPHWYirR8Q8whmcpVFS3S+P35ZmmKd vaLjoFJkTgzaaxrzvPpmPqsuS/0Y20opUhbOph9doGyHD/nnMVJmryWd5eXyYA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=lendvai.name header.s=protonmail header.b=GpjiSXvn; dmarc=pass (policy=none) header.from=lendvai.name; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705948819; a=rsa-sha256; cv=none; b=aHGTqE6S3jKPPR1du08w+a04msJcFZyGFbfFzTpHL6x2CeTUzb1tYnJwk+l2+dPJg7Z6Xe 4O/HxPPNFwglYbJ5fAzbLt083A1pYGAD9mLJGB0TGS46/qokpu83XiLxady26kkjvKBR3C vsfsMH7ItQY+PoTClCmshSFmQ2L1tQtowTalmG6aWVkPfGVqFSuufdXtZcxXW0da1YMJ+s viTl/PeeV+1ZQYXxGCEJRJ3QinzWgbT6vF4FkBRNCC8jN9AGBoBDa4pHDHZYDFKRfIdsdo NjELnLMmx48YIwN5SzvkeYU3oQxdu1cmIfsWGa8w5hc0YoKnqvC2UK2WfCIfHQ== 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 695C41E031 for ; Mon, 22 Jan 2024 19:40:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRzCs-0004rl-0k; Mon, 22 Jan 2024 13:39:38 -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 1rRzCh-0004rQ-4s for guix-devel@gnu.org; Mon, 22 Jan 2024 13:39:27 -0500 Received: from mail-4323.proton.ch ([185.70.43.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRzCd-00067D-7J; Mon, 22 Jan 2024 13:39:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail; t=1705948757; x=1706207957; bh=4cQC0ZgYfBFGu1MBU1YGxNI7R2PK8K0MZdQWBQ530Fg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=GpjiSXvnaI0c0BVoKFlkJ1k3xxbXy5fnpDG/tGGStjghxqjPzytiOKoOC2NQyqId6 ibdUGJHqzHv4UecKXE9ANnkWBSmbXGhtaR7aZoYnDeH6aQVAWlzvhjd1JwPES3vb0O 4RvpvG5IMG2oeHRe15rmRkaA+3Z171kdHXXw9THS253esSd2R+7IH0PqgmWKCSbAfh ccQfQ6lBjblqdvtp3c56jMWTp/dSe06Sly7Z8b8LF6svKdzf8589F05w3Zv/3elcf9 Z05y5DXHy8EljMnzEE4GRKyB4Smqg1wLXGv1BUC2awnmAVOJVQRIcHJzgJ6GqB5jNw WdpgDjS3KRk9w== Date: Mon, 22 Jan 2024 18:38:57 +0000 To: Maxim Cournoyer From: Attila Lendvai Cc: =?utf-8?Q?Ludovic_Court=C3=A8s?= , guix-devel Subject: Re: [shepherd] several patches that i deem ready Message-ID: In-Reply-To: <878r4ia86d.fsf@gmail.com> References: <878r4ia86d.fsf@gmail.com> Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.23; envelope-from=attila@lendvai.name; helo=mail-4323.proton.ch 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, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.54 X-Spam-Score: -8.54 X-Migadu-Queue-Id: 695C41E031 X-Migadu-Scanner: mx12.migadu.com X-TUID: AR0q5kXtL/eD hi Maxim, > > > - a lightweight logging infrastructure together with plenty of log > > > lines throughout the codebase, and some hints in the README on how > > > to turn log lines gray in emacs (i.e. easily ignorable). > > > Are you using guile-lib's logging library for it? I've used it in > guile-hall if you want to have an example. We should maximize its > users, refine it and aim to have it builtin Guile at some point. i looked at that lib first (IIRC by your recommendation), but i ended up ro= lling my own for the cost of two additional pages of code in shepherd. i th= ink the main issue i had was the amount of unconditional computation that h= appens on the common code path, and its complexity in general, including it= s API. shepherd has some non-trivial machinery regarding logging output being capt= ured and redirected through sockets to herd and whatnot; i.e. most of the h= andler machinery in guile-lib's logger would be just an impedance mismatch = instead of being helpful. for those two pages it's: - one less external dependency - less resource use - more flexibility - cheaper code path when a log level is disabled at runtime - compile-time log level to drop entire log levels - and most importantly much less code complexity. you can find the relevant commit at: https://codeberg.org/attila-lendvai-patches/shepherd/commits/branch/attila FWIW, it's a partial bort of a CL lib of mine: https://github.com/hu-dwim/hu.dwim.logger > > a quick note on the log statements: they are essentially noise when it > > comes to reading the code, hence the gray coloring i suggest in > > emacs. (although they may often serve also as "executable" comments). > > > > i'd also like to propose to relax the 80 column limit for log lines > > for the same reason that i've explained above. > > > I don't think an exception is deserved here; the logging library from > guile-lib for example concatenates message strings by default, which > makes it easy to brake long messages on multiple lines. my ultimate goal here is to minimize the disruption of code readability. on= ly some emacs (editor) magic and/or code formatting can help with that. log lines are only relevant when you're debugging something, or when you're= trying to understand a codebase. all other times they are essentially nois= e. my proposal is what our CL team settled with: always one line per log state= ment, and setting the foreground color of the entire line gray in emacs. -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CThe pursuit of commerce reconciles nations, calms wars, strengthen= s peace, and commutes the private good of individuals into the common benef= it of all.=E2=80=9D =09=E2=80=94 Hugh of Saint Victor (1096=E2=80=931141)