public function createLogger($data = array()) { $logger = $this->createComponent('Logger', $this->getPlugin()); if (!isset($data['log_file_path'])) { $data['log_file_path'] = WPRSS_LOG_FILE . '-' . get_current_blog_id() . WPRSS_LOG_FILE_EXT; } if (!isset($data['level_threshold'])) { $data['level_threshold'] = wprss_log_get_level(); } $logger->addData($data); return $logger; }
/** * Check whether or not messages with the specified logging level should be logged. * * @param int $log_level The log level to check. Must be an unsigned whole number * @return bool True if messages with the specified logging level should be logged; false otherwise. */ function wprss_log_is_logging_level($log_level) { $original_used_level = $used_log_level = wprss_log_get_level(); // Whether to use the indicated level and below $is_below = substr($used_log_level, 0, 1) === '-'; if ($is_below) { $used_log_level = substr($used_log_level, 1); } if ((int) $used_log_level === WPRSS_LOG_LEVEL_NONE) { $is_log_level = WPRSS_LOG_LEVEL_NONE; } else { $is_log_level = $is_below ? (int) $log_level <= (int) $used_log_level && (int) $log_level !== WPRSS_LOG_LEVEL_NONE : wprss_log_is_level((int) $log_level, $used_log_level); } return apply_filters('wprss_is_logging_level', $is_log_level, $log_level, $used_log_level, $is_below); }