Dan Poirier wrote: > "William A. Rowe Jr." <[email protected]> writes: > >> One thing we should refactor is 'debug' logging. Proper debug >> logging is log early and often, but there is overhead involved >> in preparing the args and submitting the log request, only to have >> it fall on deaf ears. >> >> If we are doing any significant 2.0 refactoring, toggling the >> truly-debug log level processing at compile time would be a big win. > > Do we have some measurements of how much overhead this adds?
Of course not, since it varies wildly by what is being logged. But just the preparation can consume double buffers/invoke a copy with the simple presence of an LF character. > Being able to turn on debug logging by just changing the configuration > is much more convenient than requiring a recompile, and I'd hate to give > that up without knowing we were gaining significantly in performance. One aspect would be compile-in optional logging, but another option for most modules would be runtime module log level querying. That would at least allow the authors of cpu/memory intensive logging features
