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: Tue, 05 Mar 2024 12:03:15 -0500 Message-ID: <87sf14har0.fsf@gmail.com> References: <20240302041612.29833-1-maxim.cournoyer@gmail.com> <20240302202542.353ca019@tintin> <87r0gshu6y.fsf@gmail.com> <20240304031908.67e08532@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="30003"; 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 Tue Mar 05 18:03:42 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 1rhYCc-0007aU-NR for guile-devel@m.gmane-mx.org; Tue, 05 Mar 2024 18:03:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhYCI-0006Nk-D3; Tue, 05 Mar 2024 12:03:22 -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 1rhYCH-0006MC-5J for guile-devel@gnu.org; Tue, 05 Mar 2024 12:03:21 -0500 Original-Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhYCF-0004Zl-BY for guile-devel@gnu.org; Tue, 05 Mar 2024 12:03:20 -0500 Original-Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-6901114742bso24303206d6.2 for ; Tue, 05 Mar 2024 09:03:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709658197; x=1710262997; 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=k22hLRK44vUaBJ6QkF/pTk7GATRS/uldSM2DmOIJ7Ho=; b=LBMbmo77LDPy10vUrTY11sYWjFP56bJuR6MGxcWVmKFM+XfamsO79OxEw0molZGpYR 2/I6yoPHLna2hIjOObbBHZ54lChJUvmgptHXoO4af7demLRxT8//td/IggX5xcip4cxv fJVh4IlqQU4ZFq/jPgR4BvQ5cib/i1kAwLL16F1Rzazy+F2b97EbqUcUA+3bmcfxfgtx mssx76WrivPI2oboKDsMU+w5Z1nMDLLaES2sIFMirWT+wLDCEH9G9LS//12CIKmXQXwX i1W9cYVV2DzH5+s+/yfwvGBVsIXTSLbWZMAbv5eoUOX60DN5HeDuqp2HS13kxZ4tynBG 5zXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709658197; x=1710262997; 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=k22hLRK44vUaBJ6QkF/pTk7GATRS/uldSM2DmOIJ7Ho=; b=ukQbPoFTpwpojuRoKbA3xF2ucl1KwJfKWj58QVMuB87mBciO/F/KOoqNgjLfM3n4WQ SHy9Soo3NK67h4rfFM64mAkalvuG9F7rJ9pFLWSN0V+pAt1XS8E8DwqrhNjDP6wDANY2 EeFHY45c/4upmTkgsnGUyXNhjqKjUWsMhgZZJXt8Zdb/YCFctBoAOaSISEWigrvia88m KvQJRiDpflWMOIoRUyqR1vGT5xdZr75Imefx+skV0o0StM8sCGk4zTdENP7rALSQ8Fug PrWft53tQp1EurLM++dgQKn0UnstZU07mCoVNzwHvVkUJpoA5J88ay5WC7i3XNRXaeg3 eEqw== X-Gm-Message-State: AOJu0Yy7SrznMAbgd7RGVsEZeVXrOY4capjeCUrDjvWNPgQ9SvUGET1A FsTGVm0p+Wt1KBN5wXfFcO4gGVNi3Cu9Ua6dH7/u8CyVVinTapNNhqitq+yn X-Google-Smtp-Source: AGHT+IEoh6ms+foK1iWeyvQ4XVxtXhvUvJF77l55t2gFisKEjEddF4Saq8Gke1dNlshvo1yEaxutig== X-Received: by 2002:ad4:41c3:0:b0:690:8260:953e with SMTP id a3-20020ad441c3000000b006908260953emr2966045qvq.17.1709658197403; Tue, 05 Mar 2024 09:03:17 -0800 (PST) Original-Received: from hurd (dsl-10-131-163.b2b2c.ca. [72.10.131.163]) by smtp.gmail.com with ESMTPSA id em19-20020ad44f93000000b0068fdb03a3a3sm6395166qvb.95.2024.03.05.09.03.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 09:03:16 -0800 (PST) In-Reply-To: <20240304031908.67e08532@tintin> (David Pirotte's message of "Mon, 4 Mar 2024 03:19:08 -0300") Received-SPF: pass client-ip=2607:f8b0:4864:20::f2f; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qv1-xf2f.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:22338 Archived-At: Hi David, David Pirotte writes: > Hi Maxim, > >> ... >> 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. > > Yes, it explains your point in a much better way, thanks > Please go ahead and push the patch 'as is' ... Excellent, thanks for the heads-up. I've rebased my local branch on current devel and pushed this last commit (9c75b17). I've forgotten the patman metadata in the commit message (sorry), so you may want to reword it on your side before merging to master. I don't expect to be working on the adding the new class and what was discussed as further work yet, so if you were aiming to produce a new release, the timing should be good now. -- Thanks, Maxim