all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
To: 87il7epdli.fsf@fabionatali.com
Cc: help-guix@gnu.org
Subject: Re: G-exp that makes use of guile-ini
Date: Wed, 11 Oct 2023 10:03:42 +0300	[thread overview]
Message-ID: <2242f6c4-9a96-44f7-85bc-66470051a31e@gmail.com> (raw)
In-Reply-To: <877cnup0ot.fsf@fabionatali.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1706 bytes --]

Hello,

FWIW, there was a similar issue with Guile-DSV:

   https://github.com/artyom-poptsov/guile-dsv/issues/10

The difference is that Guile-DSV API allows to set the Guile-SMC logging 
driver

and its options.


I've added the same functionality to the Guile-INI API:

https://github.com/artyom-poptsov/guile-ini/commit/82ff585070e656f66f874293327fa541382f95ed


Please check if it works for you.


Thanks,


- avp


On 11.10.2023 01:33, Fabio Natali wrote:
> Fabio Natali wrote:
>> I've been struggling with the following g-expression that makes use of
>> the guile-ini library.
> Quick update, this works well:
>
> #+begin_src scheme :noeval
> (use-modules (gnu packages guile-xyz)
> 	     (guix gexp))
>
> (define foo
>    (computed-file
>     "foo"
>     (with-imported-modules '((guix build utils))
>       (with-extensions (list guile-ini guile-smc guile-lib)
>         #~(begin
>             (use-modules (guix build utils)
> 			(ice-9 pretty-print)
> 			(ini)
> 			(smc core log))
> 	   (mkdir-p "/tmp")
> 	   (smc-log-init! "file" `((file . "/tmp/test")))
> 	   (call-with-output-file #$output
> 	     (lambda (output)
> 	       (pretty-print
> 		(call-with-input-file #$(local-file "/tmp/config.ini")
> 		  ini->scm)
> 		output))))))))
>
> foo
> #+end_src
>
> Now, that was just a stripped down version of what I need to do though!
>
> The real gexp uses =(open-pipe* OPEN_READ command ...)= instead, where
> =command= is a script that calls guile-ini (and therefore guile-smc, and
> therefore the logger). I can't use =smc-log-init!= the same way
> then... I'll keep you posted if something comes to mind.
>
> Cheers, F.
>

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7031 bytes --]

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

  reply	other threads:[~2023-10-11  7:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 22:33 G-exp that makes use of guile-ini Fabio Natali
2023-10-11  7:03 ` Artyom V. Poptsov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-12 10:07 Fabio Natali
2023-10-11  7:56 Fabio Natali
2023-10-11  8:01 ` Artyom V. Poptsov
2023-10-11 20:03 ` Artyom V. Poptsov
2023-10-10 17:54 Fabio Natali

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

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

  git send-email \
    --in-reply-to=2242f6c4-9a96-44f7-85bc-66470051a31e@gmail.com \
    --to=poptsov.artyom@gmail.com \
    --cc=87il7epdli.fsf@fabionatali.com \
    --cc=help-guix@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.