You are here

function _acquia_purge_get_diagnosis_logged in Acquia Purge 6

Same name and namespace in other branches
  1. 7 acquia_purge.deprecated.inc \_acquia_purge_get_diagnosis_logged()

Log diagnostic test results to watchdog.

@returns Void,

Parameters

array $items: Associative array with test results or an individual test result array.

See also

_acquia_purge_get_diagnosis()

2 calls to _acquia_purge_get_diagnosis_logged()
acquia_purge_expire_cache in ./acquia_purge.module
Implements hook_expire_cache().
_acquia_purge_queue_processpurge in ./acquia_purge.module
Queue manager: process a single path (on all domains and balancers).
1 string reference to '_acquia_purge_get_diagnosis_logged'
_acquia_purge_get_diagnosis in ./acquia_purge.module
Perform a series of self-tests against the site and our purging conditions.

File

./acquia_purge.module, line 412
Acquia Purge, Top-notch Varnish purging on Acquia Cloud!

Code

function _acquia_purge_get_diagnosis_logged($items) {
  $severitymap = array(
    ACQUIA_PURGE_SEVLEVEL_INFO => WATCHDOG_INFO,
    ACQUIA_PURGE_SEVLEVEL_OK => WATCHDOG_INFO,
    ACQUIA_PURGE_SEVLEVEL_WARNING => WATCHDOG_ERROR,
    ACQUIA_PURGE_SEVLEVEL_ERROR => WATCHDOG_CRITICAL,
  );

  // Wrap single a single test result into a workable array.
  if (isset($items['severity'])) {
    $items = array(
      $items,
    );
  }

  // Iterate the items and report them to the watchdog log.
  foreach ($items as $item) {
    $description = $item['description_plain'];
    if (empty($description)) {
      $description = $item['value_plain'];
    }
    watchdog('acquia_purge', $description, array(), $severitymap[$item['severity']]);
  }
}