mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:25:40 +00:00
UI: Improve console output
This commit is contained in:
parent
447e5fe336
commit
13bd3d3523
@ -52,7 +52,7 @@ const QLoggingCategory LC("fortManager");
|
||||
|
||||
void dbErrorHandler(void *context, int errCode, const char *message)
|
||||
{
|
||||
qCWarning(LC) << "DB Error:" << errCode << message;
|
||||
qCWarning(LC) << "DB Error:" << errCode << qUtf8Printable(message);
|
||||
|
||||
if (SqliteDb::isIoError(errCode)) {
|
||||
auto fortManager = static_cast<FortManager *>(context);
|
||||
|
@ -145,15 +145,9 @@ void OsUtil::showConsole(bool visible)
|
||||
void OsUtil::writeToConsole(const QString &line)
|
||||
{
|
||||
const HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (!stdoutHandle || stdoutHandle == INVALID_HANDLE_VALUE)
|
||||
return;
|
||||
|
||||
QByteArray data;
|
||||
data.append(line.toLocal8Bit());
|
||||
data.append('\n');
|
||||
|
||||
DWORD nw;
|
||||
WriteFile(stdoutHandle, data.constData(), DWORD(data.size()), &nw, nullptr);
|
||||
WriteConsoleW(stdoutHandle, line.utf16(), line.size(), &nw, nullptr);
|
||||
}
|
||||
|
||||
bool OsUtil::setCurrentThreadName(const QString &name)
|
||||
|
Loading…
Reference in New Issue
Block a user