In my game engine I output stuff for debugging purposes to the windows console using std::cout.
I wanted to use colors so I can more easily oversee what is going on, as well as some "macros" using /tags.
Let me show an example of what I am talking about:
myCout << "/warn Entity: "<< EntityName << "is doing /fgRed badstuff \n";
Warning: Entity: obj1 is doing badstuff
The way I have this is that I parse a stringstream.str() and send that string to my function that will format it and output it, but it currently looks like:
mysstream << "/warn Entity: "<< EntityName << "is doing /fgRed badstuff \n"; myCout(mysstream.str());
Obviously, I don't want to do this for every output, I want to use my output function just like std::cout, having the functionality of the same << operators, but does my formatting also.
How could I achieve this?
Your help is much appreciated!