diff options
-rw-r--r-- | sal/osl/all/log.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx index 6a5884211949..4b6016e00951 100644 --- a/sal/osl/all/log.cxx +++ b/sal/osl/all/log.cxx @@ -156,14 +156,19 @@ char const * getLogLevel() { std::ofstream * getLogFile() { // First check the environment variable, then the setting in logging.ini static char const * logFile = getEnvironmentVariable("SAL_LOG_FILE"); - if (!logFile) - return nullptr; + if (!logFile) + { #ifdef WNT - static char logFilePath[INI_STRINGBUF_SIZE]; - if (getValueFromLoggingIniFile("LogFilePath", logFilePath)) - logFile = logFilePath; + static char logFilePath[INI_STRINGBUF_SIZE]; + if (getValueFromLoggingIniFile("LogFilePath", logFilePath)) + logFile = logFilePath; + else + return nullptr; +#else + return nullptr; #endif + } // stays until process exits static std::ofstream file(logFile, std::ios::app | std::ios::out); |