Skip to content

Commit 82778de

Browse files
JohannAnhoferandibacher
authored andcommitted
Fix checking for force stderr logging and asume stderr has console
1 parent 65ed256 commit 82778de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/log4qt/consoleappender.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ void ConsoleAppender::closeStream()
132132
void ConsoleAppender::append(const LoggingEvent &event)
133133
{
134134
#ifdef Q_OS_WIN
135-
if (!GetConsoleWindow() && !qEnvironmentVariableIsEmpty("QT_ASSUME_STDERR_HAS_CONSOLE"))
135+
if (GetConsoleWindow() == nullptr &&
136+
qEnvironmentVariableIntValue("QT_ASSUME_STDERR_HAS_CONSOLE") == 0)
136137
{
137138
// if console is blocked by debugger use OutputDebugString
138139
Q_ASSERT_X(layout(), "ConsoleAppender::append()", "Layout must not be null");

0 commit comments

Comments
 (0)