From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxim Cournoyer Newsgroups: gmane.lisp.guile.devel Subject: Re: [Guile-Lib PATCH] logger: Add flush-after-emit? property to . Date: Sat, 02 Mar 2024 22:26:29 -0500 Message-ID: <87r0gshu6y.fsf@gmail.com> References: <20240302041612.29833-1-maxim.cournoyer@gmail.com> <20240302202542.353ca019@tintin> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35356"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: guile-devel@gnu.org To: David Pirotte Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Sun Mar 03 04:26:59 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rgcV8-00091I-VQ for guile-devel@m.gmane-mx.org; Sun, 03 Mar 2024 04:26:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgcUo-00058e-Q3; Sat, 02 Mar 2024 22:26:39 -0500 Original-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 1rgcUk-00056X-U1 for guile-devel@gnu.org; Sat, 02 Mar 2024 22:26:35 -0500 Original-Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgcUj-0006ws-9W for guile-devel@gnu.org; Sat, 02 Mar 2024 22:26:34 -0500 Original-Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-42ee33b2d58so2921241cf.3 for ; Sat, 02 Mar 2024 19:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709436391; x=1710041191; 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=OyitJwODnt0W23pxZQ4iMjid75mbBeYqW7y/+E2Rodk=; b=h3jS03v2JAqWdR+lnCUU8zBtDzMPbnCjqhjIpWdN54pEb3M+U0Fmi50cAuFlX/p14O Zc5BhRdaZgDcgadBh2T6NKpwouHhLk9A0v8WAO1ZMARX4rN9L0Vh7++Gr/LBcVc2YQaI tngVRiZAstezQR1p7sSKD5MWQ+HKHUKr85io4LsQ3fbMcXd/RAT0qrQKCABTpCijSmLL XaTO+uR6Wd+DmBeaNS0DgUbb2aCwkgrGQSmF72cvuV2iqyMKjmMDSDh3N2yJZd2CvpZx bKkBbGwexYY1bDOTxaoA+y0MjAfOa/GypDKTLXCjxHmnw+ie6E1Bk+RNzmWwoHkNTs93 X1fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709436391; x=1710041191; 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=OyitJwODnt0W23pxZQ4iMjid75mbBeYqW7y/+E2Rodk=; b=mNayej9hEPKK1/rCnLh5t5hBD4FqKjYVRL0OzXmiBK5ytu/pXibH7SJDIt88/BdANJ qoNNrly8UW8qQ7kdShayC6OAR9y5ne/22VaZkye6C2qWs0VT1eyzsbSb0sw4+CXwM+kr rqOHdzy+DbF1h5WdMOP16w9KkRacc5IZUMRdf80klbN5e1B8OUs0hTH/PX+vt/70Awp5 boccvgNw9M8hiS6J2bkxlWuUx8k2+uS6rBtJW1zAVcP4Sb3K5Vh8+rMZJaoBe3her2ZH 30i8T4zBPrj3QHQSsrzkAzWYdOY2Rqu9exa5u+Moxd+YdL4pzwVTifkWpf/fprC43PNw 8AZg== X-Gm-Message-State: AOJu0Yynx/D8paEf4vuwpzorE03u5/1PJ2wKTt1hqCjCh1ZrrQtboYJh 9KSZMbKmuHJe2U8n7cdo/b2k22An/RRFkWgFKIsvcQpoxJg/Of6U3pNJJ3Fx X-Google-Smtp-Source: AGHT+IE6Bnj7mcx8Q9wSejOcjyEZkGnHGqp5pZdkCHgwvuAFH7kkn9X0fCiggTqePXjyTLSE9MMKhQ== X-Received: by 2002:a0c:e1c5:0:b0:68f:3c36:1b74 with SMTP id v5-20020a0ce1c5000000b0068f3c361b74mr5692965qvl.41.1709436391044; Sat, 02 Mar 2024 19:26:31 -0800 (PST) Original-Received: from hurd (dsl-158-205.b2b2c.ca. [66.158.158.205]) by smtp.gmail.com with ESMTPSA id jh19-20020a0562141fd300b0068fef023e6esm3634764qvb.88.2024.03.02.19.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 19:26:30 -0800 (PST) In-Reply-To: <20240302202542.353ca019@tintin> (David Pirotte's message of "Sat, 2 Mar 2024 20:28:42 -0300") Received-SPF: pass client-ip=2607:f8b0:4864:20::82b; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x82b.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: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22334 Archived-At: Hi David, David Pirotte writes: > Hello Maxim, > guile-devel followers, > >> * src/logging/logger.scm (): Add new >> optional flush-after-each-emit? slot, initialized to #t. >> ... > > Maxim and i have been talking about both the v4 1-7 series of patches > that Maxim have been working on - now pushed to the devel branch if > someone wants to look at them ... as well as about this little > enhancement i wanted ... > > to avoid 'repeating the all chat' here, those interested may read our > last words about this here: > > https://logs.guix.gnu.org/guile/2024-03-02.log#043834 > > and my answers slightly below: > > https://logs.guix.gnu.org/guile/2024-03-02.log#235822 > > So, to make it short, i am asking Maxim to write this patch so it uses > buffering-mode as the new slot name, kw .. and accept either 'emit or > 'line to cover our current need, to be extended with other mode if we > wish or need to later ... My only concern about doing this, rephrasing what I wrote on the chat, is that it'd be hard to validate the input value, as that validation would need to be specialized to handlers, e.g. for some class we'd want to disallow 'line as it wouldn't apply. That's why I suggested keeping the flush on emit switch as an on/off boolean, which can live in the base class of all , and perhaps subclass into which would accept a #:buffering-mode keyword whose accepted values would mirror what setvbuf allows (line, block or none). I think that'd simplify things at the implementation level and avoid user error or surprises. Our current loggers could be derived from the new class, while something like a would inherit directly from , avoiding to handle users providing 'line or 'block to #:buffering-mode, which would need to throw a user error. Does that explain my point better (does it make sense?) If so, we can keep the patch here as-is, and the work to add a new with a #:buffering-mode keyword would become future work. -- Thanks, Maxim