Actually it doesn't:
log (lazy (Printf.printf "%s" (awfully_long_computation ())))
when log_val is false (or sylvain's solution, which I prefer), will
not behave like
Printf.ifprinf "%s" (awfully_long_computation ())
(it won't evaluate its arguments).
Till
IMHO: evaluating the arguments of your log statement will avoid some
really ugly heisenbugs- what if awfully_long_computation performs I/O
or otherwise has side effects?. Note that having side-effects in your
arguments to the log statements is a really bad idea, but people will
do it, and finding where they do it is non-trivial.