Merge Log#Log() methods

This commit is contained in:
Alexander A. Klimov 2023-08-11 13:07:37 +02:00
parent a3a6a8ab21
commit 481ef9ea72
2 changed files with 3 additions and 9 deletions

View File

@ -346,17 +346,13 @@ void Logger::UpdateCheckObjectFilterCache()
} }
Log::Log(LogSeverity severity, String facility, const String& message) Log::Log(LogSeverity severity, String facility, const String& message)
: Log(severity, std::move(facility)) : m_Severity(severity), m_Facility(std::move(facility)), m_IsNoOp(severity < Logger::GetMinLogSeverity())
{ {
if (!m_IsNoOp) { if (!m_IsNoOp && !message.IsEmpty()) {
m_Buffer << message; m_Buffer << message;
} }
} }
Log::Log(LogSeverity severity, String facility)
: m_Severity(severity), m_Facility(std::move(facility)), m_IsNoOp(severity < Logger::GetMinLogSeverity())
{ }
/** /**
* Writes the message to the application's log. * Writes the message to the application's log.
*/ */

View File

@ -122,9 +122,7 @@ public:
Log(const Log& other) = delete; Log(const Log& other) = delete;
Log& operator=(const Log& rhs) = delete; Log& operator=(const Log& rhs) = delete;
Log(LogSeverity severity, String facility, const String& message); Log(LogSeverity severity, String facility, const String& message = String());
Log(LogSeverity severity, String facility);
~Log(); ~Log();
template<typename T> template<typename T>