logger: poor placement of the function inside the ifdefs. Moving outside to make the function accessible with any logger setting.