2 ms·
Well, I could do operations for logging that are otherwise not required... if(log) { logger.write(computestuff()); }
by d--b 8y ago
Well, I could do operations for logging that are otherwise not required...
if(log) { logger.write(computestuff()); }
- meheleventyone 8y agoDepending on language if you have first class functions you could also do: logger.write(computestuff); Or for parameterized functions: logger.write(() => computestuff(a, b, c)); Then all that logging policy stuff can live with the logging and doesn't need to be checked explicitly throughout the codebase.