mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Merge pull request #7847 from Icinga/feature/log-trim-trailing-newlines-7828
Log: trim trailing newlines
This commit is contained in:
commit
00d8703aad
@ -10,6 +10,7 @@
|
|||||||
#include "base/context.hpp"
|
#include "base/context.hpp"
|
||||||
#include "base/scriptglobal.hpp"
|
#include "base/scriptglobal.hpp"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
|
||||||
@ -201,7 +202,13 @@ Log::~Log()
|
|||||||
entry.Timestamp = Utility::GetTime();
|
entry.Timestamp = Utility::GetTime();
|
||||||
entry.Severity = m_Severity;
|
entry.Severity = m_Severity;
|
||||||
entry.Facility = m_Facility;
|
entry.Facility = m_Facility;
|
||||||
entry.Message = m_Buffer.str();
|
|
||||||
|
{
|
||||||
|
auto msg (m_Buffer.str());
|
||||||
|
msg.erase(msg.find_last_not_of("\n") + 1u);
|
||||||
|
|
||||||
|
entry.Message = std::move(msg);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_Severity >= LogWarning) {
|
if (m_Severity >= LogWarning) {
|
||||||
ContextTrace context;
|
ContextTrace context;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user