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>
This commit is contained in:
Thorsten Behrens
2018-06-05 11:35:36 +02:00
parent 3012ae908a
commit 423d01ec92
+10 -5
View File
@@ -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);