diff options
| author | Peter Maydell | 2013-02-26 18:52:40 +0100 |
|---|---|---|
| committer | Anthony Liguori | 2013-02-26 20:31:47 +0100 |
| commit | 989b697ddd46769b0999e8cd16b5ecd393204734 (patch) | |
| tree | 3775c51b27f9a21cd69ce36e948ee0b6eb5b943f /include | |
| parent | show --disable-gtk and --enable-gtk in the help message (diff) | |
| download | qemu-989b697ddd46769b0999e8cd16b5ecd393204734.tar.gz qemu-989b697ddd46769b0999e8cd16b5ecd393204734.tar.xz qemu-989b697ddd46769b0999e8cd16b5ecd393204734.zip | |
qemu-log: default to stderr for logging output
Switch the default for qemu_log logging output from "/tmp/qemu.log"
to stderr. This is an incompatible change in some sense, but logging
is mostly used for debugging purposes so it shouldn't affect production
use. The previous behaviour can be obtained by adding "-D /tmp/qemu.log"
to the command line.
This change requires us to:
* update all the documentation/help text (we take the opportunity
to smooth out minor inconsistencies between the phrasing in
linux-user/bsd-user/system help messages)
* make linux-user and bsd-user defer to qemu-log for the default
logging destination rather than overriding it themselves
* ensure that all logfile closing is done via qemu_log_close()
and that that function doesn't close stderr
as well as the obvious change to the behaviour of do_qemu_set_log()
when no logfile name has been specified.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1361901160-28729-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/qemu/log.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/qemu/log.h b/include/qemu/log.h index 452700329e..6b0db02efc 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -116,8 +116,12 @@ static inline void qemu_log_flush(void) /* Close the log file */ static inline void qemu_log_close(void) { - fclose(qemu_logfile); - qemu_logfile = NULL; + if (qemu_logfile) { + if (qemu_logfile != stderr) { + fclose(qemu_logfile); + } + qemu_logfile = NULL; + } } /* Set up a new log file */ |
