Improve efficiency if logging is disabled