Flush buffer after adding a string, not before.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-06-21 14:16:17 +03:00
parent f2c8481f53
commit 13a8b83a0e
3 changed files with 7 additions and 4 deletions

View file

@ -159,6 +159,9 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
break;
}
vStdOut().flush();
vStdErr().flush();
if (isGuiThread)
{
//fixme: trying to make sure there are no save/load dialogs are opened, because error message during them will

View file

@ -170,6 +170,8 @@ inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &con
default:
break;
}
vStdOut().flush();
vStdErr().flush();
(*qApp->LogFile()) << debugdate << endl;
}

View file

@ -82,18 +82,16 @@ static const auto V_UNUSED V_EX_CONFIG = 78; /*Something was found in an un
//---------------------------------------------------------------------------------------------------------------------
inline QTextStream& vStdErr()
{
static QTextStream ts( stderr );
static QTextStream ts(stderr, QIODevice::Unbuffered | QIODevice::WriteOnly);
ts.setCodec("UTF-8");
ts.flush();
return ts;
}
//---------------------------------------------------------------------------------------------------------------------
inline QTextStream& vStdOut()
{
static QTextStream ts( stdout );
static QTextStream ts(stdout, QIODevice::Unbuffered | QIODevice::WriteOnly);
ts.setCodec("UTF-8");
ts.flush();
return ts;
}