watchdog_skip_semaphore

Versions
mediamosa-21
watchdog_skip_semaphore($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)

Replacement of the watchdog() function that eliminates the use of semaphores so that we can test the abortion of an action loop.

Code

modules/simpletest/tests/actions_loop_test.module, line 73

<?php
function watchdog_skip_semaphore($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
  global $user, $base_root;

  // Prepare the fields to be logged
  $log_entry = array(
    'type'        => $type,
    'message'     => $message,
    'variables'   => $variables,
    'severity'    => $severity,
    'link'        => $link,
    'user'        => $user,
    'request_uri' => $base_root . request_uri(),
    'referer'     => $_SERVER['HTTP_REFERER'],
    'ip'          => ip_address(),
    'timestamp'   => REQUEST_TIME,
  );

  // Call the logging hooks to log/process the message
  foreach (module_implements('watchdog') as $module) {
    module_invoke($module, 'watchdog', $log_entry);
  }
}
?>