Don't log if logging is disabled

Previously this guard was in the logging method itself, should it be moved back there instead?