M
Mikael
Hi!
I have written a logging class for my project and I want to support the
stream syntax, that is I would like to write like this in my code:
Log log("MYPREFIX");
log << "This is a message, which is being sent to syslog, value ="
<< 5;
I have created a friend function:
Log& operator<< (Log& log, std::string& str);
So now I can write:
log << "Only strings are supported";
However this doesn't work (of course):
log << "This will create two log messages" << " why isn't this
concatenated?";
I wonder if someone knows about some documentation which could aid me
in making my log class stream-compatible.
Regards,
Mikael
I have written a logging class for my project and I want to support the
stream syntax, that is I would like to write like this in my code:
Log log("MYPREFIX");
log << "This is a message, which is being sent to syslog, value ="
<< 5;
I have created a friend function:
Log& operator<< (Log& log, std::string& str);
So now I can write:
log << "Only strings are supported";
However this doesn't work (of course):
log << "This will create two log messages" << " why isn't this
concatenated?";
I wonder if someone knows about some documentation which could aid me
in making my log class stream-compatible.
Regards,
Mikael