Refactored loggerWrapper to use switch on creation only