Commit 8036f691 authored by Mihai Moldovan's avatar Mihai Moldovan

nxcomp/src/Log.cpp: don't confuse users with useless warning messages in case…

nxcomp/src/Log.cpp: don't confuse users with useless warning messages in case that a log line append operation was requested, but the message level has lower precedence than the current log filter.
parent 56dbc215
...@@ -123,15 +123,19 @@ NXLog& operator<< (NXLog& out, const NXLogStamp& value) ...@@ -123,15 +123,19 @@ NXLog& operator<< (NXLog& out, const NXLogStamp& value)
/* Appending means that the log object's internal level and the message level must match. */ /* Appending means that the log object's internal level and the message level must match. */
if (out.current_level() == value.level()) if (out.current_level() == value.level())
{ {
/* And the buffer must of course be non-empty. */ /* Discard, if the message is not supposed to be written out anyway. */
if (out.has_buffer()) if (out.will_log ())
{ {
out << " (cont.) "; /* And the buffer must of course be non-empty. */
} if (out.has_buffer())
else {
{ out << " (cont.) ";
std::cerr << "WARNING: Append operation requested, but no queued data available. " }
<< "Internal state error!\n" << "Log line will be discarded!" << std::endl; else
{
std::cerr << "WARNING: Append operation requested, but no queued data available. "
<< "Internal state error!\n" << "Log line will be discarded!" << std::endl;
}
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment