diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-06-04 13:41:22 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-06-05 17:08:02 +0200 |
commit | 777fe663fdcccc8ae2233cfb8287e888a9e5bf87 (patch) | |
tree | 90e4f5f452dcdd53abd1b6006b6bc0ae1e003822 | |
parent | 6083c974531afe0d9a80c5e3d5f883f194703684 (diff) |
sal: fix logfile path retrieval from logging.ini
Change-Id: I39803413533ae5b291d2e1abf4aa1bfe1f5900b5
Reviewed-on: https://gerrit.libreoffice.org/55268
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit 423d01ec92a2c99ca8309a78f6763478e299f6a3)
Reviewed-on: https://gerrit.libreoffice.org/55321
-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); |