SDL: Make logMessage() implementation independent from parent class(es)
This commit is contained in:
parent
7607a077fe
commit
3599d07087
1 changed files with 13 additions and 1 deletions
|
@ -275,10 +275,22 @@ void OSystem_SDL::fatalError() {
|
|||
|
||||
|
||||
void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) {
|
||||
ModularBackend::logMessage(type, message);
|
||||
// First log to stdout/stderr
|
||||
FILE *output = 0;
|
||||
|
||||
if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
|
||||
output = stdout;
|
||||
else
|
||||
output = stderr;
|
||||
|
||||
fputs(message, output);
|
||||
fflush(output);
|
||||
|
||||
// Then log into file (via the logger)
|
||||
if (_logger)
|
||||
_logger->print(message);
|
||||
|
||||
// Finally, some Windows / WinCE specific logging code.
|
||||
#if defined( USE_WINDBG )
|
||||
#if defined( _WIN32_WCE )
|
||||
TCHAR buf_unicode[1024];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue