I've got a program that does some stuff, and has logging information being printed to one file, other stuff going to cout, and errors going to cerr. I want to re-direct cerr to a log file, without messing up anything else. Basically, if there is an option specified in the config file, write cerr to ./error.log, otherwise, write it to /dev/null or whatever. How do I do this? Can I just open a fstream object and assing cerr to it? I'd appreciate an example (simple, of course)
Thanks
Mike B.
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
Thanks
Mike B.
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.