Printing messages only if message has at least a specified priority.

This commit is contained in:
Patrick Lühne 2016-11-24 00:24:35 +01:00
parent 93597f16a0
commit 1103f5cbf1
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF

View File

@ -101,6 +101,9 @@ void Logger::log(Priority priority, const char *message)
{
const auto priorityID = static_cast<int>(priority);
if (priorityID < static_cast<int>(m_outputPriority))
return;
auto &stream =
(priorityID > static_cast<int>(Priority::Warning))
? m_errorStream
@ -119,6 +122,9 @@ void Logger::log(Priority priority, const input::Location &location, const char
{
const auto priorityID = static_cast<int>(priority);
if (priorityID < static_cast<int>(m_outputPriority))
return;
auto &stream =
(priorityID > static_cast<int>(Priority::Warning))
? m_errorStream