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
No known key found for this signature in database
GPG Key ID: 05F3611E97A70ABF
1 changed files with 6 additions and 0 deletions

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