You are here

function watchdog_skip_semaphore in SimpleTest 7

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

2 calls to watchdog_skip_semaphore()
actions_loop_test_init in tests/actions_loop_test.module
Implement hook_init().
actions_loop_test_log in tests/actions_loop_test.module
Write a message to the log.

File

tests/actions_loop_test.module, line 73

Code

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);
  }
}