I have made a pretty big program which prints very much information to the screen all the time. The thing is that I can't be there all the time to read and eventually spot errors. So I came up with the idea to write everything that is printed by cout to a file. The problem is that, how I already wrote, there are plenty "cout's". Working through the whole code and replacing every cout by a custom function would be very annoying.
Is there a way I how I can "hook" cout to be redirected to a custom function of mine?