unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: David Pirotte <david@altosw.be>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: guile-devel@gnu.org
Subject: Re: [Guile-Lib PATCH] logger: Add flush-after-emit? property to <log-handler>.
Date: Mon, 4 Mar 2024 03:19:08 -0300	[thread overview]
Message-ID: <20240304031908.67e08532@tintin> (raw)
In-Reply-To: <87r0gshu6y.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

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 <log-handler>, and
> perhaps subclass <log-handler> into <stream-handler> 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 <stream-handler>
> class, while something like a <syslog-handler> would inherit directly
> from <log-handler>, 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 <stream-handler>
> 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' ... 

Cheers,
David

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2024-03-04  6:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02  4:15 [Guile-Lib PATCH] logger: Add flush-after-emit? property to <log-handler> Maxim Cournoyer
2024-03-02 23:28 ` David Pirotte
2024-03-03  3:26   ` Maxim Cournoyer
2024-03-04  6:19     ` David Pirotte [this message]
2024-03-05 17:03       ` Maxim Cournoyer
2024-03-10  1:46         ` David Pirotte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240304031908.67e08532@tintin \
    --to=david@altosw.be \
    --cc=guile-devel@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).