Boost logo

Boost Users :

From: Dan Dimerman (dimerman_at_[hidden])
Date: 2004-12-22 11:25:07


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net