mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-23 17:57:54 +02:00
Log#Log(): require passing one involved object
This commit is contained in:
parent
481ef9ea72
commit
6b642b270e
@ -345,8 +345,9 @@ void Logger::UpdateCheckObjectFilterCache()
|
||||
m_ObjectFilterCache.swap(allObjects);
|
||||
}
|
||||
|
||||
Log::Log(LogSeverity severity, String facility, const String& message)
|
||||
: m_Severity(severity), m_Facility(std::move(facility)), m_IsNoOp(severity < Logger::GetMinLogSeverity())
|
||||
Log::Log(LogSeverity severity, String facility, const ConfigObject::Ptr& involved, const String& message)
|
||||
: m_Severity(severity), m_Facility(std::move(facility)),
|
||||
m_Involved(involved), m_IsNoOp(severity < Logger::GetMinLogSeverity())
|
||||
{
|
||||
if (!m_IsNoOp && !message.IsEmpty()) {
|
||||
m_Buffer << message;
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "base/atomic.hpp"
|
||||
#include "base/i2-base.hpp"
|
||||
#include "base/configobject.hpp"
|
||||
#include "base/logger-ti.hpp"
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
@ -122,7 +123,7 @@ public:
|
||||
Log(const Log& other) = delete;
|
||||
Log& operator=(const Log& rhs) = delete;
|
||||
|
||||
Log(LogSeverity severity, String facility, const String& message = String());
|
||||
Log(LogSeverity severity, String facility, const ConfigObject::Ptr& involved, const String& message = String());
|
||||
~Log();
|
||||
|
||||
template<typename T>
|
||||
@ -140,6 +141,7 @@ public:
|
||||
private:
|
||||
LogSeverity m_Severity;
|
||||
String m_Facility;
|
||||
ConfigObject::Ptr m_Involved;
|
||||
std::ostringstream m_Buffer;
|
||||
bool m_IsNoOp;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user