apache / logging-log4cxx

Apache Log4cxx is a C++ port of Apache Log4j
http://logging.apache.org/log4cxx
Apache License 2.0
273 stars 122 forks source link

Condition internal debug logging on its enabled state #384

Closed swebb2066 closed 5 months ago

rm5248 commented 5 months ago

Since we have a lot of internal log messages that only log strings, would it make sense to make a vararg or parameter packed version of LogLog::debug()? That way you could do something like LogLog::debug("Opening file ", filename, " failed"); which would automatically concatenate the strings. That would also make the LOGLOG_DEBUG macro more useful.

swebb2066 commented 5 months ago

would it make sense to make a vararg or parameter packed version of LogLog::debug()?

I do not know how to use parameter packs and achieve avoiding message building when debug is disabled. I believe internal debug logging is currently sparse (limited to infrequently executed code) to reduce overhead. The LogLog::isDebugEnabled() is much higher overhead than Logger::isDebugEnabledFor(logger)