make printf-like functions lazy

See issue #8 . Some code is duplicated, but not much (logf cannot use log in its implementation). Signatures of printf-like functions use out_channel rather than strings, but overall it doesn't change how the functions are used, and should be more efficient (no intermediate string).