Added conditional useage of logging facilities based on preprocessor flag.