Skip to content

Commit

Permalink
Log: fix some parts of messages not being discarded early
Browse files Browse the repository at this point in the history
`m_IsNoOp` was introduced to avoid building up log messages that will later be
discarded, like debug messages if no debug logging is configured. However, it
looks like the template operator<< implemented in the header file was forgotten
when adding this feature, all other places writing into `m_Buffer` already have
an if guard like added by this commit.
  • Loading branch information
julianbrost committed Sep 27, 2024
1 parent b6b1506 commit f0e084d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/base/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ class Log
template<typename T>
Log& operator<<(const T& val)
{
m_Buffer << val;
if (!m_IsNoOp) {
m_Buffer << val;
}

return *this;
}

Expand Down

0 comments on commit f0e084d

Please sign in to comment.