diff --git a/simgear/debug/logstream.cxx b/simgear/debug/logstream.cxx index 92adbe34..36b5650c 100644 --- a/simgear/debug/logstream.cxx +++ b/simgear/debug/logstream.cxx @@ -712,7 +712,7 @@ void logstream::setStartupLoggingEnabled(bool enabled) d->setStartupLoggingEnabled(enabled); } -void logstream::requestConsole() +void logstream::requestConsole(bool ignoreErrors) { #if defined (SG_WINDOWS) const bool stderrAlreadyRedirected = d->m_stderr_isRedirectedAlready; @@ -751,7 +751,8 @@ void logstream::requestConsole() std::cerr.clear(); } } else { - MessageBox(0, "--console ignored because stdout or stderr redirected with > or 2>", "Simgear Error", MB_OK | MB_ICONERROR); + if (!ignoreErrors) + MessageBox(0, "--console ignored because stdout or stderr redirected with > or 2>", "Simgear Error", MB_OK | MB_ICONERROR); } #endif } @@ -767,9 +768,9 @@ logstream::setTestingMode( bool testMode ) namespace simgear { -void requestConsole() -{ - sglog().requestConsole(); +void requestConsole(bool ignoreErrors) +{ + sglog().requestConsole(ignoreErrors); } diff --git a/simgear/debug/logstream.hxx b/simgear/debug/logstream.hxx index c58c3cb0..195daeac 100644 --- a/simgear/debug/logstream.hxx +++ b/simgear/debug/logstream.hxx @@ -44,7 +44,7 @@ class LogCallback; * we need to show a console. This basically means Windows at the * moment - on other plaforms it's a no-op */ -void requestConsole(); +void requestConsole(bool ignoreErrors); void shutdownLogging(); @@ -65,7 +65,7 @@ public: * we need to show a console. This basically means Windows at the * moment - on other plaforms it's a no-op */ - void requestConsole(); + void requestConsole(bool ignoreErrors); /** * Set the global log class and priority level.