[Logger] Add missing checks for whether logging is enabled