qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Fergeau <cfergeau@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] log: Make glib logging go through QEMU
Date: Thu, 13 Dec 2018 12:57:41 +0100	[thread overview]
Message-ID: <20181213115741.GD19201@natto.ory.fergeau.eu> (raw)
In-Reply-To: <20181213115212.GF5171@redhat.com>

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

On Thu, Dec 13, 2018 at 11:52:12AM +0000, Daniel P. Berrangé wrote:
> On Thu, Dec 13, 2018 at 12:26:12PM +0100, Christophe Fergeau wrote:
> > This commit adds a qemu_init_logging() helper which calls
> > g_log_set_default_handler() so that glib logs (g_log, g_warning, ...)
> > are handled similarly to other QEMU logs. This means they will get a
> > timestamp if timestamps are enabled, and they will go through the
> > monitor if one is configured.
> > This commit also adds a call to qemu_init_logging() to the binaries
> > installed by QEMU.
> > 
> > At the moment, this change will mostly impact SPICE logging if your
> > spice version is >= 0.14.1. With older spice versions, this is not going
> > to work as expected, but will not have any ill effect, so this call is
> > not conditional on the SPICE version.
> > 
> > Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
> > ---
> > Changes since v1:
> > - introduced a qemu_init_logging() helper, and call that in more
> >   binaries than just vl.c
> 
> > +static void qemu_log_func(const gchar *log_domain,
> > +                          GLogLevelFlags log_level,
> > +                          const gchar *message,
> > +                          gpointer user_data)
> > +{
> > +    switch (log_level & G_LOG_LEVEL_MASK) {
> > +    case G_LOG_LEVEL_DEBUG:
> > +        break;
> > +    case G_LOG_LEVEL_INFO:
> > +        /* Fall through */
> > +    case G_LOG_LEVEL_MESSAGE:
> > +        info_report("%s", message);
> > +        break;
> > +    case G_LOG_LEVEL_WARNING:
> > +        /* Fall through */
> > +    case G_LOG_LEVEL_CRITICAL:
> > +        warn_report("%s", message);
> > +        break;
> 
> This didn't adress my previous comment that _CRITICAL should do an
> error_report, not warn_reoprt.

My bad, sorry for missing it, v3 incoming.

Christophe

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

      reply	other threads:[~2018-12-13 11:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 11:26 [Qemu-devel] [PATCH v2] log: Make glib logging go through QEMU Christophe Fergeau
2018-12-13 11:52 ` Daniel P. Berrangé
2018-12-13 11:57   ` Christophe Fergeau [this message]

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=20181213115741.GD19201@natto.ory.fergeau.eu \
    --to=cfergeau@redhat.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.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 NNTP newsgroup(s).