Luiz Capitulino <lcapitul...@redhat.com> writes: > On Mon, 29 Jul 2013 23:23:32 +0200 > Andreas Färber <afaer...@suse.de> wrote: > >> Am 29.07.2013 23:20, schrieb Luiz Capitulino: >> > On Mon, 22 Jul 2013 23:23:29 +0200 >> > Andreas Färber <afaer...@suse.de> wrote: >> >> Am 22.07.2013 23:03, schrieb Seiji Aguchi: >> >>> Convert stderr messages calling error_get_pretty() >> >>> to error_report(). >> >> >> >> How is this related to error_get_pretty()? >> > >> > Yeah, we're converting fprintf(stderr,) calls to error_report() so that >> > error messages get a timestamp. >> >> Want to add that to my http://wiki.qemu.org/DeveloperNews so that people >> reading it stop adding new ones? :) > > Big IMHO here, but honestly speaking I'm not a huge fan of error_report() > because I think that random code shouldn't be allowed to print to the > monitor (only HMP code should).
A conversion from fprintf() to error_report() is always an improvement, because 1. It makes the nature of the message explicit in the code. 2. It prints the error message in the proper form, with error location when available. 3. When called in monitor context, it prints to the monitor rather than stderr. Printing directly to the monitor may not be clean, but it sure beats printing to stderr, where the monitor user can't see it unless the monitor happens to be on stdio. Besides, there's plenty of code that doesn't ever run in monitor context, thus needn't worry about QMP vs. HMP. > But it's widespread and it's where the timestamp lives, so calling fprintf() > instead of error_report() will probably start hurting soon.