Avoid creating a background logging thread if USE_LOGGING is defined as 0.