Replace calls to fprintf with new tr_* macros
Add logging to the default main config