[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/11] misc: Add trailing '\n' to
From: |
John Snow |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/11] misc: Add trailing '\n' to qemu_log() calls |
Date: |
Fri, 8 Jun 2018 11:07:27 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 06/08/2018 06:54 AM, Peter Maydell wrote:
> On 6 June 2018 at 20:43, John Snow <address@hidden> wrote:
>> so error_setg must be used WITHOUT \n and logging must happen with \n?
>>
>> If we're sure that's the way we want to have things laid out, we really
>> ought to augment checkpatch to catch this -- because there's 0% chance
>> that we'll keep it straight on our own otherwise.
>
> It's a historical side effect of them being basically separately
> designed APIs. error_setg() takes the "give it the entire error
> message" approach. logging is printf-style and gives the caller
> flexibility to compose more complicated lines of logging with
> multiple calls. Consistency between the two might be nice but
> there are an awful lot of qemu_log calls in the codebase to check
> and change to the other convention...
>
Well, there's a pragmatic reason against having it be uniform.
If logging lets you build more complicated statements, perhaps a
checkpatch /warning/ that you've omitted the newline might be nice.
--js
- [Qemu-trivial] [PATCH 07/11] stellaris: Add trailing '\n' to qemu_log() calls, (continued)
- [Qemu-trivial] [PATCH 07/11] stellaris: Add trailing '\n' to qemu_log() calls, Philippe Mathieu-Daudé, 2018/06/06
- [Qemu-trivial] [PATCH 06/11] hw/mips/boston: Add trailing '\n' to qemu_log() calls, Philippe Mathieu-Daudé, 2018/06/06
- [Qemu-trivial] [PATCH 08/11] target/arm: Add trailing '\n' to qemu_log() calls, Philippe Mathieu-Daudé, 2018/06/06
- [Qemu-trivial] [PATCH 09/11] target/m68k: Add trailing '\n' to qemu_log() call, Philippe Mathieu-Daudé, 2018/06/06
- [Qemu-trivial] [PATCH 10/11] RISC-V: Add trailing '\n' to qemu_log() calls, Philippe Mathieu-Daudé, 2018/06/06
- [Qemu-trivial] [RFC PATCH 11/11] target/xtensa: Add trailing '\n' to qemu_log() calls, Philippe Mathieu-Daudé, 2018/06/06
- Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/11] misc: Add trailing '\n' to qemu_log() calls, John Snow, 2018/06/06
- Re: [Qemu-trivial] [PATCH 00/11] misc: Add trailing '\n' to qemu_log() calls, Peter Maydell, 2018/06/08