replace ofstream log/err/out to clog/cerr/cout accordingly