Win32 console; added method to ignore errors
This is mainly for standalone FGCOM - because the error message is always shown because it is a console app and --console isn't required.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user