poco
poco copied to clipboard
Optimize multi-arg logger methods to only call format() if log level allows
Example:
inline void Logger::debug(const std::string& fmt, const Any& value1)
{
log(Poco::format(fmt, value1), Message::PRIO_DEBUG);
}
should become:
inline void Logger::debug(const std::string& fmt, const Any& value1)
{
if (debug())
{
logAlways(Poco::format(fmt, value1), Message::PRIO_DEBUG);
}
}
// ...
inline void Logger::logAlways(const std::string& text, Message::Priority prio, const char* file, int line)
{
if (_pChannel)
{
_pChannel->log(Message(_name, text, prio, file, line));
}
}
This issue is stale because it has been open for 365 days with no activity.
This issue was closed because it has been inactive for 60 days since being marked as stale.