summaryrefslogtreecommitdiffstats
path: root/extensions/source/logging/simpletextformatter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/logging/simpletextformatter.cxx')
-rw-r--r--extensions/source/logging/simpletextformatter.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/extensions/source/logging/simpletextformatter.cxx b/extensions/source/logging/simpletextformatter.cxx
index 83416e61c7d6..71e40a362562 100644
--- a/extensions/source/logging/simpletextformatter.cxx
+++ b/extensions/source/logging/simpletextformatter.cxx
@@ -61,17 +61,14 @@ OUString SAL_CALL SimpleTextFormatter::getHead() { return OUString(); }
OUString SAL_CALL SimpleTextFormatter::format(const LogRecord& _rRecord)
{
- OUStringBuffer aLogEntry;
+ OUString aLogEntry;
// Highlight warnings
if (_rRecord.Level == css::logging::LogLevel::SEVERE)
- aLogEntry.append("ERROR: ");
- if (_rRecord.Level == css::logging::LogLevel::WARNING)
- aLogEntry.append("WARNING: ");
+ aLogEntry = "ERROR: ";
+ else if (_rRecord.Level == css::logging::LogLevel::WARNING)
+ aLogEntry = "WARNING: ";
- aLogEntry.append(_rRecord.Message);
- aLogEntry.append("\n");
-
- return aLogEntry.makeStringAndClear();
+ return aLogEntry + _rRecord.Message + "\n";
}
OUString SAL_CALL SimpleTextFormatter::getTail() { return OUString(); }