You are here

private function EntityPagerAdvice::logAdvice in Entity Pager 7

Log advice.

Create a Performance Message and log it watchdog.

Parameters

string $advice_type: The type of advice.

string $issue: The specific issue.

1 call to EntityPagerAdvice::logAdvice()
EntityPagerAdvice::runAdviceLogic in includes/EntityPagerAdvice.inc
Run advice logic.

File

includes/EntityPagerAdvice.inc, line 102
A class to manage advice when using the Entity Pager module.

Class

EntityPagerAdvice
Class EntityPagerAdvice.

Code

private function logAdvice($advice_type, $issue) {
  $view = $this
    ->getView();
  switch ($advice_type) {
    case 'no-records':
      watchdog('entity_pager', "Performance Advice: in the View ('@view_name'),\n                the issue ('@reason'), means you are needlessly attempting to\n                displaying an empty Entity Pager block on this page.\n                To ignore this advice, you can turn this alert off at:\n                @view_name view > Format > Settings > Log performance\n                suggestions.", array(
        '@view_name' => $view->human_name,
        '@reason' => $issue,
      ), WATCHDOG_INFO);
      break;
    case 'quantity':
      watchdog('entity_pager', "Performance Advice: in the View ('@view_name'),\n                the issue ('@reason'). At the moment there are 500+ records in\n                your pager. The Entity Pager module is constructed to be fast\n                keeping processing to a minimum, that said, it might still be a\n                good idea to cache the Views Query Result see:\n                @view_name view > Other > Caching. (Note: do not cache the\n                Rendered output). To ignore this advice, you can turn this\n                alert off at: @view_name view > Format > Settings >\n                Log performance suggestions.", array(
        '@view_name' => $view->human_name,
        '@reason' => $issue,
      ), WATCHDOG_INFO);
  }
}