Fixes unused function warning by aligning #if condition with header

Xcode displays a warning that the function is not used if LOGGER_DEBUG is false.