BACKENDS: Add OSystem::displayLogFile interface + OSX implementation
This commit is contained in:
parent
ae4b298bbb
commit
279a5b4f32
5 changed files with 81 additions and 4 deletions
|
@ -73,6 +73,10 @@ Common::String OSystem_POSIX::getDefaultConfigFileName() {
|
|||
}
|
||||
|
||||
Common::WriteStream *OSystem_POSIX::createLogFile() {
|
||||
// Start out by resetting _logFilePath, so that in case
|
||||
// of a failure, we know that no log file is open.
|
||||
_logFilePath.clear();
|
||||
|
||||
const char *home = getenv("HOME");
|
||||
if (home == NULL)
|
||||
return 0;
|
||||
|
@ -128,7 +132,10 @@ Common::WriteStream *OSystem_POSIX::createLogFile() {
|
|||
logFile += "/scummvm.log";
|
||||
|
||||
Common::FSNode file(logFile);
|
||||
return file.createWriteStream();
|
||||
Common::WriteStream *stream = file.createWriteStream();
|
||||
if (stream)
|
||||
_logFilePath = logFile;
|
||||
return stream;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue