didn't think about that. Wouldn't it require partly reinventing the printf mechanism?
Suppose a case with 3 parameters:
Log( "%d %s %d", 3, "test", 3, level, true );
that would use
InternalLogStream( iLevel, bLineEnd, Format ) << arg0 << arg1 << arg2;
Each call to << should move on to the next '%' found in the format string, convert the argument, append result to internal string. That's what printf does..
edit after thinking it through: it's really not a bad idea at all. It would require a call to 'Flush' or so after the InternalLogStream() calls because it has no way of knowing which argument is the last one, but I like the fact it uses templates: there's no way you can write a call with an argument that doesn't support conversion as the compiler would spot it immedeately so it's safer than normal printf. It might be somewhat slower though, still have to figure that out.
Bookmarks