Replace calls to fprintf with new tr_* macros