[Libreoffice-commits] core.git: Branch 'feature/cib_contract57' - sal/osl
Thorsten Behrens
Thorsten.Behrens at CIB.de
Fri Jan 27 17:00:20 UTC 2017
sal/osl/all/log.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit c7f35d079fd364f236ce1df6ee1f32bb80d1cd22
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date: Fri Jan 27 17:58:24 2017 +0100
sal: flush log-to-file, remove extra linefeeds otherwise
syslog and windows debugger console don't need explicit line feeds.
For ofstream, use endl which implies a flush.
Change-Id: Id94e07aa1ae042557052fab6483e5db75aada89d
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index 42fc5e8..c7ea797 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -346,7 +346,8 @@ void log(
+ (std::strncmp(where, SRCDIR "/", nStrLen) == 0
? nStrLen : 0));
}
- s << message << '\n';
+ s << message;
+
#if defined ANDROID
int android_log_level;
switch (level) {
@@ -389,7 +390,7 @@ void log(
} else {
static std::ofstream * logFile = getLogFile();
if (logFile) {
- *logFile << s.str();
+ *logFile << s.str() << std::endl;
}
#if defined WNT
else {
@@ -397,6 +398,7 @@ void log(
}
#else
else {
+ s << '\n';
std::fputs(s.str().c_str(), stderr);
std::fflush(stderr);
}
More information about the Libreoffice-commits
mailing list