LogDir: fixed order of output in -log.html

Calling the parent logger may invoke flushing in LogRedirect.  This
needs to be done before writing the log message which causes that
flushing, otherwise the order of lines in the -log.html file is
slightly wrong.
This commit is contained in:
Patrick Ohly 2011-01-27 12:25:48 +01:00
parent c3813499c3
commit 73e1d29a13

View file

@ -788,6 +788,17 @@ public:
const char *format,
va_list args)
{
// always to parent first (usually stdout):
// if the parent is a LogRedirect instance, then
// it'll flush its own output first, which ensures
// that the new output comes later (as desired)
{
va_list argscopy;
va_copy(argscopy, args);
m_parentLogger.messagev(level, prefix, file, line, function, format, argscopy);
va_end(argscopy);
}
if (m_report &&
level <= ERROR &&
m_report->getError().empty()) {
@ -806,8 +817,6 @@ public:
m_client.getEngine().doDebug(level, prefix, file, line, function, format, argscopy);
va_end(argscopy);
}
// always to parent (usually stdout)
m_parentLogger.messagev(level, prefix, file, line, function, format, args);
}
virtual bool isProcessSafe() const { return false; }