
29 Oct
2004
29 Oct
'04
9:26 a.m.
Daniel Frey <daniel.frey@aixigo.de> wrote:
logger("app.gui") << "something GUIsh"; Though I am not sure, if a compiler will be able to optimize checks for every operator<<() to a single check for the entire output expression.
Now replace "something GUIsh" with anExpensiveFunction(). John's code will not evaluate it when the logger is disabled. OTOH your code will always evaluate it, which is IMHO not acceptable for a logging library.
Well, that is true, though my logging needs has never required calling any expensive functions. -- Maxim Yegorushkin