Hi everyone,
ok, the title is not the best one.. however, this is the thing:
I'm writing a small class to keep track of log messages from my program.
Say the class is calloed ILog. I'd love to be able to do at least one of the following:
ILog log;
int myInt=0;
log << "Hey" << " this is a message and an integer: " << myInt; // option 1
log("Hey" << "this is a message and an integer: " << myInt); // option 2
Moreover I need to pass in both cases a parameter (saying the verbosity of the message) but that should not be a problem once I can setup this first part.
I tried to have a member function which accepts an ostream object as the parameter but still I have the problem that the first object should be an ostream.
Do someone have some good ideas? I'm probably missing something stupid..
Thanks!!
Simone