22 Dec
2004
22 Dec
'04
4:25 p.m.
Foster, Gareth wrote:
Could you do Logger<DBG> MyLogger; MyLogger.print(); ?
It wont have the same effect, for if I parametrize the class itself, I will end up having as many actual instances as severity levels. Parametrizing the print function allows me to use the same logger (with its corresponding devices such as files, console, etc.) for different levels. Since the actual function to be called is resolved at compile time, I get to avoid costly constructions (mostly string concatenation and such) for debug purposes to be carried in the release version (assuming the compiler notices...). Dan