qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] rust/qemu-api: Add initial logging support based on C


From: Paolo Bonzini
Subject: Re: [PATCH v2 1/2] rust/qemu-api: Add initial logging support based on C API
Date: Wed, 11 Jun 2025 13:05:35 +0200

On Wed, Jun 11, 2025 at 12:57 PM Manos Pitsidianakis
<manos.pitsidianakis@linaro.org> wrote:

> Maybe we could take this chance to remove the requirement for trailing
> newline? Not urgent, and also something we could change afterwards
> anyway. We could also introduce log_mask_ln! macro but now I'm just
> bikeshedding.

Good idea; there is no "formatln!" but I think you could use concat instead.

If that doesn't work for whatever reason we can indeed add it later. I
had the idea of a struct that wraps the logging functions
qemu_log_trylock() and qemu_log_unlock() and implements io::Write; at
which point, implementing log_mask_ln! (or _nl! following the unstable
format_args_nl!) with writeln! would be trivial.

> Besides that, I think it'd be useful to have the macro re-exported in
> rust/qemu-api/src/prelude.rs as well. Please add it for the next
> version.

Yes, I agree.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]