tj_log: Expose fprintf logging function, and can configure FILE.

Allows it to be reused multiple times with different FILEs.