From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 8KgYEozBr2UqPQEAe85BDQ:P1 (envelope-from ) for ; Tue, 23 Jan 2024 14:39:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 8KgYEozBr2UqPQEAe85BDQ (envelope-from ) for ; Tue, 23 Jan 2024 14:39:24 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JGEKYDvA; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706017164; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ZzadRYSXXJc2xe5rnAFD+//UIFDQjIRuB19yZD/LjL4=; b=ISR8pW3YzCDzameu0oYcDshOGbP/4frnYEMasusJYkFs8P3HCS0Hsj9MBB/2Xebj5PkAzS ArgnwlL0KerjVj8agsFwzxv9M6APhJSe2DMAEhqpXmOBrg9Yxy1kGPLY1q9Bws6tFSRzrB r/TVLAJ3SXifFWtGkLsT+R6JstwHQeNEl2+KdfB31fr8tIZpNEncIfgfcUzWgMMwJZygd5 EAKuD5HK4z89PbCQvBXT8Hlg3h0IeWTQGPQ+zdx6s80r0HGRvIxPYHWIB4Jekxsp5MEVpy /UqQQPFdPFxKPPl2zJlUtDSTfqi63h7HhwV/656dxIso3xQCxzZsdrMDm3qf9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=JGEKYDvA; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706017164; a=rsa-sha256; cv=none; b=PLMf/ZiczmOGDONkLWhNP/CP6jDvDQHOdXBa1ZFcAxbtVtJKM51KDsYWqBvHQq8lccJqGL uRo2KT9qZEoMmdcaheBht9Fy3AqyXpG9a1f+d73vWzZAdhhquaQrb6kdn+SjyBKOrmYHAc jvz8xnG9/UZqDJlrR/4gNrEo1lxdKIVPLdP0jnIEJIzALnm15rwbIfc5rTBtih40Wu19B2 I2XmvBYib51//wYtmnBGOhQKzOv0JYu+reHL0aJ3SfvRynXqCnBwOz9Jf+0KXVfCW4NqUX pGfXO/IAb2JnrQugxjl8km6Q+8cm5/CNYqNxlFoIE8BxEgPr66qo7epxVufhTA== 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 E850216388 for ; Tue, 23 Jan 2024 14:39:23 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSGid-0008SP-4y; Tue, 23 Jan 2024 08:21:35 -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 1rSGib-0008SG-1B for guix-devel@gnu.org; Tue, 23 Jan 2024 08:21:33 -0500 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSGiY-0004dJ-SY; Tue, 23 Jan 2024 08:21:32 -0500 Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-42a49d42ec6so6999491cf.1; Tue, 23 Jan 2024 05:21:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706016088; x=1706620888; darn=gnu.org; h=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=ZzadRYSXXJc2xe5rnAFD+//UIFDQjIRuB19yZD/LjL4=; b=JGEKYDvAy3XyJuoPbyjkCUpo/9kzmbqHrcTE10194nvyiPlHrSc4sDoUi0LSTSJ0cx ySu3XD9yNsfFpM4eWZznzP9/4zpci8dFyOt2Ngsuhm/3Fs3OhW9lQ4/M+egFLu76t2JJ pxWaH/hxUe4PHtBZKto4uh8qwXa2YmelZiWNEapaUkDPGyVWyYVD05IKmCoIYCRoTL/b +IF755t/WFQAJewQ6HgHhF5ridP3noJF/FFkt1LIWeAkK1jgWlFfNrpb/cXYu/vRZE3l qpUGgToSn6rKQ6upHImTG3CKYQvvWz28O5Q42FEKxSsj4Ve/Zd3A0CvcPuOoc4zPQBrY SKzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706016088; x=1706620888; h=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=ZzadRYSXXJc2xe5rnAFD+//UIFDQjIRuB19yZD/LjL4=; b=AyzVHt02klXhcogRy9ll20dhp6M3kIpZ98dQZWhgeacm1fORqbi5t9dCMx20S81VNE cNFQBj6SKhvolv1/j3l34RKqunoeYJp+JaVHwpurRNhVDjt+qZzTi3lMkAUET+ppEJdO CSUFIjQQoxGXgSgtoZ9eNdtCQgfjnQPfqvXGX5CRV1UzzDdYdhS350U1Yg+HVhpgLPem geuoDLD7xBjRh2Jbs3BeMIhr0djyY/r3Gk9BUQgTM59/x/7BDbyaEDgUTwuQGs2Q4Zak Ro5AWmFNIRkm8XZMcwsRhHQ6LUy/OsNohMKvRVV2Uz6SVBGyXHyTgX21WmWz8MyvKTeZ wpLg== X-Gm-Message-State: AOJu0YzHJfjnXgY92CNVZ8WwJJblNL04LJInQkZl3u+4ZE3j+uyhrrAG 3jgMLNGuCdOzI4ghmGHSUopzi9Q1MRtBg/TFOXX0nqwwTg/oHF7TnK2CkFYX X-Google-Smtp-Source: AGHT+IG5SB+Bt69Feg2DRPQtIdZNRzJFtncxgpI0jvCw1cbr1cpnePqDSryEHA/x6O/m3ogtpO8ImA== X-Received: by 2002:ac8:7f4d:0:b0:42a:53f4:3198 with SMTP id g13-20020ac87f4d000000b0042a53f43198mr479811qtk.99.1706016087768; Tue, 23 Jan 2024 05:21:27 -0800 (PST) Received: from hurd (dsl-158-18.b2b2c.ca. [66.158.158.18]) by smtp.gmail.com with ESMTPSA id k18-20020ac81412000000b004280cad48basm3463416qtj.77.2024.01.23.05.21.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:21:27 -0800 (PST) From: Maxim Cournoyer To: Attila Lendvai Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , guix-devel Subject: Re: [shepherd] several patches that i deem ready In-Reply-To: (Attila Lendvai's message of "Mon, 22 Jan 2024 18:38:57 +0000") References: <878r4ia86d.fsf@gmail.com> Date: Tue, 23 Jan 2024 08:21:25 -0500 Message-ID: <87a5ow2nje.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x836.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-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: -9.99 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -9.99 X-Migadu-Queue-Id: E850216388 X-TUID: GQg6Y0mT3PWS Hi Attila, Attila Lendvai writes: > 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 rolling my own for the cost of two additional pages of code in > shepherd. i think the main issue i had was the amount of unconditional > computation that happens on the common code path, and its complexity > in general, including its API. > > shepherd has some non-trivial machinery regarding logging output being > captured and redirected through sockets to herd and whatnot; i.e. most > of the handler machinery in guile-lib's logger would be just an > impedance mismatch instead of being helpful. Since we can define a custom logger for guile-lib, I'm a bit surprised by this, but it's true that this logging library is quite minimal/naive. > 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. About "cheaper code path when a log level is disabled at runtime", perhaps it can be improved in guile-lib, but otherwise that's a nice list. I just wish we had a good logging library in Guile and could stop reinventing the wheel left and right. > 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. only 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 noise. > > my proposal is what our CL team settled with: always one line per log statement, and setting the foreground color of the entire line gray in emacs. OK. For levels greater than debug, they I see them as glorified comments (executable comments as yo wrote), so I don't see a strong reason to attempt to hide them or treat them specially. In Python (which strives to be readable), we typically break logging lines (which are concatenated for free inside the parens -- default Python behavior), and that doesn't hurt readability in my opinion, and means we can just follow the usual style rules, keeping things simple. Thanks for working on this, I'm sure it'll help many, myself included, following the execution of Shepherd more easily. -- Thanks, Maxim