On 25/04/2018, kefu chai wrote: [snip] > > no. see > === 8< ==== > template <typename... Args> > void log(log_level level, const char* fmt, Args&&... args) { > if (is_enabled(level)) { > try { > do_log(level, fmt, std::forward<Args>(args)...); > } catch (...) { > failed_to_log(std::current_exception()); > } > } > } > === >8 === I have thought off and on and chatted with a few others about the using a binary log, since the runtime cost of all that stringification at high log levels is Not Insignificant. If we required that only contiguous objects could be logged (or continguous subobjects. Maybe define an operator that gives returns an address/length pair.) it would also solve the evaluation problem handily. The only choice would be whether to dump or not. (That might be too limiting, though we could probably get a good deal of mileage from it.) Even using encode/decode would probably be an improvement over straight-up stringification. We could possibly make a macro for logging that implicitly constructs a lambda that's only evaluated if the log level is high enough. -- Senior Software Engineer Red Hat Storage, Ann Arbor, MI, US IRC: Aemerson@OFTC, Actinic@Freenode 0x80F7544B90EDBFB9 E707 86BA 0C1B 62CC 152C 7C12 80F7 544B 90ED BFB9 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html