Remove unnecessary check for opt_debug on every invocation of applog at LOG_DEBUG and place the check in applog().