From: "Daniel P. Berrange" <berrange@redhat.com>
To: Alistair Francis <alistair.francis@xilinx.com>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [RFC v1 2/3] util/qemu-error: Add a warning_report() function
Date: Wed, 28 Jun 2017 17:19:27 +0100 [thread overview]
Message-ID: <20170628161927.GQ29134@redhat.com> (raw)
In-Reply-To: <CAKmqyKNEgZPMdS5B4J09XVpDQt0LXw0YFbMdBa_fnBXmnndftA@mail.gmail.com>
On Wed, Jun 28, 2017 at 09:16:45AM -0700, Alistair Francis wrote:
> On Wed, Jun 28, 2017 at 2:04 AM, Daniel P. Berrange <berrange@redhat.com> wrote:
> > On Tue, Jun 27, 2017 at 01:45:45PM -0700, Alistair Francis wrote:
> >> Add a functino which can be used similarly to error_report() execpt to
> >> inform the users about warnings instead of errors.
> >>
> >> The warning print does not include the timestamp and instead will
> >> preface the messages with a 'warning: '.
> >
> > Not including the timestamp is a bug IMHO. If I've turned on timestamps,
> > I expect all messages to have the timestamp.
>
> That's fine, I'm happy to add it back in. I just wasn't sure.
>
> >
> > I'm not particularly convinced by adding the 'warning: ' prefix either,
> > particularly given the scenario you are using this in, is not actually
> > a warning - its just a informative message.
>
> Maybe it makes more sense to add an extra argument to error_report()
> that can be used to specify error, warning or information. The same
> way qemu_log_mask() works. That was Edgar's idea in reply to one of
> the other patches.
>
> Does that sound more useful?
I'd suggest renaming the current 'error_report' to 'message_report' and
making it take an extra arg that accepts a enum flag INFO | WARNING | ERROR.
Then add macros for error_report, warning_report, info_report that call
message_report with the right enum. That way you don't have to update any
of the existing code that calls error_report.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2017-06-28 16:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-27 20:45 [Qemu-devel] [RFC v1 0/3] Implement a warning_report function Alistair Francis
2017-06-27 20:45 ` [Qemu-devel] [RFC v1 1/3] util/qemu-error: Rename error_print_loc() to be more generic Alistair Francis
2017-06-28 4:32 ` Philippe Mathieu-Daudé
2017-06-27 20:45 ` [Qemu-devel] [RFC v1 2/3] util/qemu-error: Add a warning_report() function Alistair Francis
2017-06-27 22:21 ` Thomas Huth
2017-06-28 0:16 ` Alistair Francis
2017-06-28 9:04 ` Daniel P. Berrange
2017-06-28 16:16 ` Alistair Francis
2017-06-28 16:19 ` Daniel P. Berrange [this message]
2017-06-29 7:38 ` Markus Armbruster
2017-06-27 20:45 ` [Qemu-devel] [RFC v1 3/3] char-socket: Report TCP socket waiting as a warning Alistair Francis
2017-06-27 21:10 ` Edgar E. Iglesias
2017-06-28 0:17 ` Alistair Francis
2017-06-28 6:15 ` Edgar E. Iglesias
2017-06-28 16:18 ` Alistair Francis
2017-06-28 9:07 ` [Qemu-devel] [RFC v1 0/3] Implement a warning_report function Daniel P. Berrange
2017-06-28 15:49 ` Alistair Francis
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=20170628161927.GQ29134@redhat.com \
--to=berrange@redhat.com \
--cc=alistair.francis@xilinx.com \
--cc=armbru@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).