unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: guile-devel@gnu.org
Subject: guile-lib logging formatters
Date: Mon, 29 Apr 2024 10:40:12 +0100	[thread overview]
Message-ID: <87bk5s1p8j.fsf@cbaines.net> (raw)

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

Hey!

I ran in to some problems with the <log-handler> formatter recently, it
seems it's being called with more than 3 arguments since the update to
guile-lib 0.2.8.

Can you advise on how to approach this?

I presume this isn't some internal interface I'm using accidentally? The
documentation states:

  #:formatter

    This optional parameter must be a function that takes three
    arguments: the log level, the time (as from current-time), and the
    log string itself. The function must return a string representing
    the formatted log.


So far I've been making this change as it's the neatest way I've come up
with of making the formatters both forward and backwards compatible:

  https://git.savannah.gnu.org/cgit/guix/nar-herder.git/commit/?id=6be6f63c9f03b7bc928f7927a38da91f95f57ea2

It's not very neat though. I did try something like:

  (lambda* (lvl time str #:allow-other-keys) ...)

But that doesn't seem to be valid Guile.

Thanks,

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

                 reply	other threads:[~2024-04-29  9:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87bk5s1p8j.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=guile-devel@gnu.org \
    /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).