[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v1 2/3] util/qemu-error: Add a warning_report() fu
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [RFC v1 2/3] util/qemu-error: Add a warning_report() function |
Date: |
Thu, 29 Jun 2017 09:38:55 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
"Daniel P. Berrange" <address@hidden> writes:
> 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 <address@hidden> 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.
*Functions*, please, not macros. Macros would bloat the code for no
benefit at all.
[Qemu-devel] [RFC v1 3/3] char-socket: Report TCP socket waiting as a warning, Alistair Francis, 2017/06/27
Re: [Qemu-devel] [RFC v1 0/3] Implement a warning_report function, Daniel P. Berrange, 2017/06/28