Hacker News new | ask | show | jobs
by meheleventyone 2919 days ago
Depending 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.