by hitsthings · 8y ago · 0 comments
if(log) { logger.write(computestuff()); } 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.