I would make logging depend upon a bool that is initialized from the environment, not a compile time flag.