aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/sdl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/sdl/sdl.cpp')
-rw-r--r--backends/platform/sdl/sdl.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 57f77fde6d..e4726dcd16 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -406,6 +406,22 @@ void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) {
_logger->print(message);
}
+Common::WriteStream *OSystem_SDL::createLogFile() {
+ // Start out by resetting _logFilePath, so that in case
+ // of a failure, we know that no log file is open.
+ _logFilePath.clear();
+
+ Common::String logFile = getDefaultLogFileName();
+ if (logFile.empty())
+ return nullptr;
+
+ Common::FSNode file(logFile);
+ Common::WriteStream *stream = file.createWriteStream();
+ if (stream)
+ _logFilePath = logFile;
+ return stream;
+}
+
Common::String OSystem_SDL::getSystemLanguage() const {
#if defined(USE_DETECTLANG) && !defined(WIN32)
// Activating current locale settings