(WIN32) Skip console attach when logging to file (#14163)
This commit is contained in:
parent
05fb6fd9a3
commit
b44ad6f890
|
@ -699,21 +699,23 @@ static void frontend_win32_attach_console(void)
|
||||||
bool need_stderr = (GetFileType(GetStdHandle(STD_ERROR_HANDLE))
|
bool need_stderr = (GetFileType(GetStdHandle(STD_ERROR_HANDLE))
|
||||||
== FILE_TYPE_UNKNOWN);
|
== FILE_TYPE_UNKNOWN);
|
||||||
|
|
||||||
|
if (config_get_ptr()->bools.log_to_file)
|
||||||
|
return;
|
||||||
|
|
||||||
if (need_stdout || need_stderr)
|
if (need_stdout || need_stderr)
|
||||||
{
|
{
|
||||||
if (!AttachConsole( ATTACH_PARENT_PROCESS))
|
if (!AttachConsole(ATTACH_PARENT_PROCESS))
|
||||||
AllocConsole();
|
AllocConsole();
|
||||||
|
|
||||||
SetConsoleTitle("Log Console");
|
SetConsoleTitle("Log Console");
|
||||||
|
|
||||||
if (need_stdout)
|
if (need_stdout)
|
||||||
freopen( "CONOUT$", "w", stdout );
|
freopen("CONOUT$", "w", stdout);
|
||||||
if (need_stderr)
|
if (need_stderr)
|
||||||
freopen( "CONOUT$", "w", stderr );
|
freopen("CONOUT$", "w", stderr);
|
||||||
|
|
||||||
console_needs_free = true;
|
console_needs_free = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue