2 ms·
There are other languages of course where the logging avoids this, even in libraries written by the same company that writes Go. In C++, the Abseil logging libr
by jeffbee 3y ago
There are other languages of course where the logging avoids this, even in libraries written by the same company that writes Go. In C++, the Abseil logging library (f.k.a. glog) will not evaluate a condition for a disabled log level.
LOG(INFO) << WowExpensiveFunction();
This is safe when the log level is set to WARN or higher. For the same reasons, LOG_EVERY_N and LOG_FIRST_N in the same library are pretty cheap.