Modify the standard output and error in fprintf