Commit 6b951d3f authored by Dries's avatar Dries

- Patch #1136130 by Crell: don't duplicate watchdog level constants.

parent 0edd27cb
......@@ -39,7 +39,7 @@
*/
function authorize_access_denied_page() {
drupal_add_http_header('Status', '403 Forbidden');
watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING);
watchdog('access denied', 'authorize.php', NULL, LOG_WARNING);
drupal_set_title('Access denied');
return t('You are not allowed to access this page.');
}
......
......@@ -14,11 +14,11 @@
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
if (!isset($_GET['cron_key']) || variable_get('cron_key', 'drupal') != $_GET['cron_key']) {
watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE);
watchdog('cron', 'Cron could not run because an invalid key was used.', array(), LOG_NOTICE);
drupal_access_denied();
}
elseif (variable_get('maintenance_mode', 0)) {
watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE);
watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), LOG_NOTICE);
drupal_access_denied();
}
else {
......
......@@ -59,7 +59,7 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a
static $stack;
$stack++;
if ($stack > variable_get('actions_max_stack', 35)) {
watchdog('actions', 'Stack overflow: too many calls to actions_do(). Aborting to prevent infinite recursion.', array(), WATCHDOG_ERROR);
watchdog('actions', 'Stack overflow: too many calls to actions_do(). Aborting to prevent infinite recursion.', array(), LOG_ERR);
return;
}
$actions = array();
......@@ -311,7 +311,7 @@ function actions_synchronize($delete_orphans = FALSE) {
$link = l(t('Remove orphaned actions'), 'admin/config/system/actions/orphan');
$count = count($actions_in_db);
$orphans = implode(', ', $orphaned);
watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_WARNING);
watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), LOG_WARNING);
}
}
}
......
......@@ -318,7 +318,7 @@ function ajax_get_form() {
// system/ajax without actually viewing the concerned form in the browser.
// This is likely a hacking attempt as it never happens under normal
// circumstances, so we just do nothing.
watchdog('ajax', 'Invalid form POST data.', array(), WATCHDOG_WARNING);
watchdog('ajax', 'Invalid form POST data.', array(), LOG_WARNING);
drupal_exit();
}
......
......@@ -37,94 +37,6 @@
*/
define('CACHE_TEMPORARY', -1);
/**
* Log message severity -- Emergency: system is unusable.
*
* The WATCHDOG_* constant definitions correspond to the logging severity levels
* defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
*
* @see watchdog()
* @see watchdog_severity_levels()
*/
define('WATCHDOG_EMERGENCY', 0);
/**
* Log message severity -- Alert: action must be taken immediately.
*
* The WATCHDOG_* constant definitions correspond to the logging severity levels
* defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
*
* @see watchdog()
* @see watchdog_severity_levels()
*/
define('WATCHDOG_ALERT', 1);
/**
* Log message severity -- Critical: critical conditions.
*
* The WATCHDOG_* constant definitions correspond to the logging severity levels
* defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
*
* @see watchdog()
* @see watchdog_severity_levels()
*/
define('WATCHDOG_CRITICAL', 2);
/**
* Log message severity -- Error: error conditions.
*
* The WATCHDOG_* constant definitions correspond to the logging severity levels
* defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
*
* @see watchdog()
* @see watchdog_severity_levels()
*/
define('WATCHDOG_ERROR', 3);
/**
* Log message severity -- Warning: warning conditions.
*
* The WATCHDOG_* constant definitions correspond to the logging severity levels
* defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
*
* @see watchdog()
* @see watchdog_severity_levels()
*/
define('WATCHDOG_WARNING', 4);
/**
* Log message severity -- Notice: normal but significant condition.
*
* The WATCHDOG_* constant definitions correspond to the logging severity levels
* defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
*
* @see watchdog()
* @see watchdog_severity_levels()
*/
define('WATCHDOG_NOTICE', 5);
/**
* Log message severity -- Informational: informational messages.
*
* The WATCHDOG_* constant definitions correspond to the logging severity levels
* defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
*
* @see watchdog()
* @see watchdog_severity_levels()
*/
define('WATCHDOG_INFO', 6);
/**
* Log message severity -- Debug: debug-level messages.
*
* The WATCHDOG_* constant definitions correspond to the logging severity levels
* defined in RFC 3164, section 4.1.1: http://www.faqs.org/rfcs/rfc3164.html
*
* @see watchdog()
* @see watchdog_severity_levels()
*/
define('WATCHDOG_DEBUG', 7);
/**
* First bootstrap phase: initialize configuration.
*/
......@@ -1437,7 +1349,7 @@ function request_uri() {
* @see watchdog()
* @see drupal_decode_exception()
*/
function watchdog_exception($type, Exception $exception, $message = NULL, $variables = array(), $severity = WATCHDOG_ERROR, $link = NULL) {
function watchdog_exception($type, Exception $exception, $message = NULL, $variables = array(), $severity = LOG_ERR, $link = NULL) {
// Use a default value if $message is not set.
if (empty($message)) {
......@@ -1472,14 +1384,14 @@ function watchdog_exception($type, Exception $exception, $message = NULL, $varia
* translate.
* @param $severity
* The severity of the message, as per RFC 3164. Possible values are
* WATCHDOG_ERROR, WATCHDOG_WARNING, etc.
* LOG_ERR, LOG_WARNING, etc.
* @param $link
* A link to associate with the message.
*
* @see watchdog_severity_levels()
* @see hook_watchdog()
*/
function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
function watchdog($type, $message, $variables = array(), $severity = LOG_NOTICE, $link = NULL) {
global $user, $base_root;
static $in_error_state = FALSE;
......
......@@ -2436,7 +2436,7 @@ function drupal_deliver_page($page_callback_result, $default_delivery_callback =
// If a delivery callback is specified, but doesn't exist as a function,
// something is wrong, but don't print anything, since it's not known
// what format the response needs to be in.
watchdog('delivery callback not found', 'callback %callback not found: %q.', array('%callback' => $delivery_callback, '%q' => $_GET['q']), WATCHDOG_ERROR);
watchdog('delivery callback not found', 'callback %callback not found: %q.', array('%callback' => $delivery_callback, '%q' => $_GET['q']), LOG_ERR);
}
}
......@@ -2469,7 +2469,7 @@ function drupal_deliver_html_page($page_callback_result) {
// Print a 404 page.
drupal_add_http_header('Status', '404 Not Found');
watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
watchdog('page not found', check_plain($_GET['q']), NULL, LOG_WARNING);
// Keep old path for reference, and to allow forms to redirect to it.
if (!isset($_GET['destination'])) {
......@@ -2498,7 +2498,7 @@ function drupal_deliver_html_page($page_callback_result) {
case MENU_ACCESS_DENIED:
// Print a 403 page.
drupal_add_http_header('Status', '403 Forbidden');
watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
watchdog('access denied', check_plain($_GET['q']), NULL, LOG_WARNING);
// Keep old path for reference, and to allow forms to redirect to it.
if (!isset($_GET['destination'])) {
......@@ -5015,7 +5015,7 @@ function drupal_cron_run() {
// Try to acquire cron lock.
if (!lock_acquire('cron', 240.0)) {
// Cron is still running normally.
watchdog('cron', 'Attempting to re-run cron while it is already running.', array(), WATCHDOG_WARNING);
watchdog('cron', 'Attempting to re-run cron while it is already running.', array(), LOG_WARNING);
}
else {
// Make sure every queue exists. There is no harm in trying to recreate an
......@@ -5031,7 +5031,7 @@ function drupal_cron_run() {
// Record cron time
variable_set('cron_last', REQUEST_TIME);
watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);
watchdog('cron', 'Cron run completed.', array(), LOG_NOTICE);
// Release cron lock.
lock_release('cron');
......@@ -5062,7 +5062,7 @@ function drupal_cron_run() {
function drupal_cron_cleanup() {
// See if the semaphore is still locked.
if (variable_get('cron_semaphore', FALSE)) {
watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), WATCHDOG_WARNING);
watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), LOG_WARNING);
// Release cron semaphore
variable_del('cron_semaphore');
......@@ -7038,14 +7038,14 @@ function drupal_parse_info_format($data) {
*/
function watchdog_severity_levels() {
return array(
WATCHDOG_EMERGENCY => t('emergency'),
WATCHDOG_ALERT => t('alert'),
WATCHDOG_CRITICAL => t('critical'),
WATCHDOG_ERROR => t('error'),
WATCHDOG_WARNING => t('warning'),
WATCHDOG_NOTICE => t('notice'),
WATCHDOG_INFO => t('info'),
WATCHDOG_DEBUG => t('debug'),
LOG_EMERG => t('emergency'),
LOG_ALERT => t('alert'),
LOG_CRIT => t('critical'),
LOG_ERR => t('error'),
LOG_WARNING => t('warning'),
LOG_NOTICE => t('notice'),
LOG_INFO => t('info'),
LOG_DEBUG => t('debug'),
);
}
......
......@@ -27,24 +27,24 @@
*/
function drupal_error_levels() {
$types = array(
E_ERROR => array('Error', WATCHDOG_ERROR),
E_WARNING => array('Warning', WATCHDOG_WARNING),
E_PARSE => array('Parse error', WATCHDOG_ERROR),
E_NOTICE => array('Notice', WATCHDOG_NOTICE),
E_CORE_ERROR => array('Core error', WATCHDOG_ERROR),
E_CORE_WARNING => array('Core warning', WATCHDOG_WARNING),
E_COMPILE_ERROR => array('Compile error', WATCHDOG_ERROR),
E_COMPILE_WARNING => array('Compile warning', WATCHDOG_WARNING),
E_USER_ERROR => array('User error', WATCHDOG_ERROR),
E_USER_WARNING => array('User warning', WATCHDOG_WARNING),
E_USER_NOTICE => array('User notice', WATCHDOG_NOTICE),
E_STRICT => array('Strict warning', WATCHDOG_DEBUG),
E_RECOVERABLE_ERROR => array('Recoverable fatal error', WATCHDOG_ERROR),
E_ERROR => array('Error', LOG_ERR),
E_WARNING => array('Warning', LOG_WARNING),
E_PARSE => array('Parse error', LOG_ERR),
E_NOTICE => array('Notice', LOG_NOTICE),
E_CORE_ERROR => array('Core error', LOG_ERR),
E_CORE_WARNING => array('Core warning', LOG_WARNING),
E_COMPILE_ERROR => array('Compile error', LOG_ERR),
E_COMPILE_WARNING => array('Compile warning', LOG_WARNING),
E_USER_ERROR => array('User error', LOG_ERR),
E_USER_WARNING => array('User warning', LOG_WARNING),
E_USER_NOTICE => array('User notice', LOG_NOTICE),
E_STRICT => array('Strict warning', LOG_DEBUG),
E_RECOVERABLE_ERROR => array('Recoverable fatal error', LOG_ERR),
);
// E_DEPRECATED and E_USER_DEPRECATED were added in PHP 5.3.0.
if (defined('E_DEPRECATED')) {
$types[E_DEPRECATED] = array('Deprecated function', WATCHDOG_DEBUG);
$types[E_USER_DEPRECATED] = array('User deprecated function', WATCHDOG_DEBUG);
$types[E_DEPRECATED] = array('Deprecated function', LOG_DEBUG);
$types[E_USER_DEPRECATED] = array('User deprecated function', LOG_DEBUG);
}
return $types;
}
......@@ -129,7 +129,7 @@ function _drupal_decode_exception($exception) {
'%function' => $caller['function'],
'%file' => $caller['file'],
'%line' => $caller['line'],
'severity_level' => WATCHDOG_ERROR,
'severity_level' => LOG_ERR,
);
}
......
......@@ -507,7 +507,7 @@ function file_create_htaccess($directory, $private = TRUE) {
}
else {
$variables = array('%directory' => $directory, '!htaccess' => '<br />' . nl2br(check_plain($htaccess_lines)));
watchdog('security', "Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: <code>!htaccess</code>", $variables, WATCHDOG_ERROR);
watchdog('security', "Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: <code>!htaccess</code>", $variables, LOG_ERR);
}
}
......@@ -896,7 +896,7 @@ function file_unmanaged_copy($source, $destination = NULL, $replace = FILE_EXIST
file_ensure_htaccess();
// Perform the copy operation.
if (!@copy($source, $destination)) {
watchdog('file', 'The specified file %file could not be copied to %destination.', array('%file' => $source, '%destination' => drupal_realpath($destination)), WATCHDOG_ERROR);
watchdog('file', 'The specified file %file could not be copied to %destination.', array('%file' => $source, '%destination' => drupal_realpath($destination)), LOG_ERR);
return FALSE;
}
......@@ -1261,7 +1261,7 @@ function file_unmanaged_delete($path) {
// Resolve streamwrapper URI to local path.
$path = drupal_realpath($path);
if (is_dir($path)) {
watchdog('file', '%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path), WATCHDOG_ERROR);
watchdog('file', '%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path), LOG_ERR);
return FALSE;
}
if (is_file($path)) {
......@@ -1270,12 +1270,12 @@ function file_unmanaged_delete($path) {
// Return TRUE for non-existent file, but log that nothing was actually
// deleted, as the current state is the intended result.
if (!file_exists($path)) {
watchdog('file', 'The file %path was not deleted, because it does not exist.', array('%path' => $path), WATCHDOG_NOTICE);
watchdog('file', 'The file %path was not deleted, because it does not exist.', array('%path' => $path), LOG_NOTICE);
return TRUE;
}
// We cannot handle anything other than files and directories. Log an error
// for everything else (sockets, symbolic links, etc).
watchdog('file', 'The file %path is not of a recognized type so it was not deleted.', array('%path' => $path), WATCHDOG_ERROR);
watchdog('file', 'The file %path is not of a recognized type so it was not deleted.', array('%path' => $path), LOG_ERR);
return FALSE;
}
......@@ -2104,7 +2104,7 @@ function drupal_chmod($uri, $mode = NULL) {
}
}
watchdog('file', 'The file permissions could not be set on %uri.', array('%uri' => $uri), WATCHDOG_ERROR);
watchdog('file', 'The file permissions could not be set on %uri.', array('%uri' => $uri), LOG_ERR);
return FALSE;
}
......
......@@ -1244,7 +1244,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) {
foreach ($value as $v) {
if (!isset($options[$v])) {
form_error($elements, $t('An illegal choice has been detected. Please contact the site administrator.'));
watchdog('form', 'Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), WATCHDOG_ERROR);
watchdog('form', 'Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), LOG_ERR);
}
}
}
......@@ -1263,7 +1263,7 @@ function _form_validate(&$elements, &$form_state, $form_id = NULL) {
}
elseif (!isset($options[$elements['#value']])) {
form_error($elements, $t('An illegal choice has been detected. Please contact the site administrator.'));
watchdog('form', 'Illegal choice %choice in %name element.', array('%choice' => $elements['#value'], '%name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), WATCHDOG_ERROR);
watchdog('form', 'Illegal choice %choice in %name element.', array('%choice' => $elements['#value'], '%name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), LOG_ERR);
}
}
}
......
......@@ -96,7 +96,7 @@ function image_toolkit_invoke($method, stdClass $image, array $params = array())
array_unshift($params, $image);
return call_user_func_array($function, $params);
}
watchdog('image', 'The selected image handling toolkit %toolkit can not correctly process %function.', array('%toolkit' => $image->toolkit, '%function' => $function), WATCHDOG_ERROR);
watchdog('image', 'The selected image handling toolkit %toolkit can not correctly process %function.', array('%toolkit' => $image->toolkit, '%function' => $function), LOG_ERR);
return FALSE;
}
......
......@@ -791,7 +791,7 @@ function drupal_uninstall_modules($module_list = array(), $uninstall_dependents
module_invoke($module, 'uninstall');
drupal_uninstall_schema($module);
watchdog('system', '%module module uninstalled.', array('%module' => $module), WATCHDOG_INFO);
watchdog('system', '%module module uninstalled.', array('%module' => $module), LOG_INFO);
// Now remove the menu links for all paths declared by this module.
if (!empty($paths)) {
......
......@@ -562,7 +562,7 @@ function _locale_import_po($file, $langcode, $mode, $group = NULL) {
if ($skips) {
$skip_message = format_plural($skips, 'One translation string was skipped because it contains disallowed HTML.', '@count translation strings were skipped because they contain disallowed HTML.');
drupal_set_message($skip_message);
watchdog('locale', '@count disallowed HTML string(s) in %file', array('@count' => $skips, '%file' => $file->uri), WATCHDOG_WARNING);
watchdog('locale', '@count disallowed HTML string(s) in %file', array('@count' => $skips, '%file' => $file->uri), LOG_WARNING);
}
return TRUE;
}
......@@ -1956,7 +1956,7 @@ function _locale_rebuild_js($langcode = NULL) {
watchdog('locale', 'Updated JavaScript translation file for the language %language.', array('%language' => t($language->name)));
return TRUE;
case 'rebuilt':
watchdog('locale', 'JavaScript translation file %file.js was lost.', array('%file' => $language->javascript), WATCHDOG_WARNING);
watchdog('locale', 'JavaScript translation file %file.js was lost.', array('%file' => $language->javascript), LOG_WARNING);
// Proceed to the 'created' case as the JavaScript translation file has
// been created again.
case 'created':
......@@ -1966,7 +1966,7 @@ function _locale_rebuild_js($langcode = NULL) {
watchdog('locale', 'Removed JavaScript translation file for the language %language, because no translations currently exist for that language.', array('%language' => t($language->name)));
return TRUE;
case 'error':
watchdog('locale', 'An error occurred during creation of the JavaScript translation file for the language %language.', array('%language' => t($language->name)), WATCHDOG_ERROR);
watchdog('locale', 'An error occurred during creation of the JavaScript translation file for the language %language.', array('%language' => t($language->name)), LOG_ERR);
return FALSE;
default:
// No operation needed.
......
......@@ -152,7 +152,7 @@ function drupal_mail($module, $key, $to, $language, $params = array(), $from = N
// Log errors
if (!$message['result']) {
watchdog('mail', 'Error sending e-mail (from %from to %to).', array('%from' => $message['from'], '%to' => $message['to']), WATCHDOG_ERROR);
watchdog('mail', 'Error sending e-mail (from %from to %to).', array('%from' => $message['from'], '%to' => $message['to']), LOG_ERR);
drupal_set_message(t('Unable to send e-mail. Contact the site administrator if the problem persists.'), 'error');
}
}
......
......@@ -448,7 +448,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
module_invoke($module, 'install');
// Record the fact that it was installed.
$modules_installed[] = $module;
watchdog('system', '%module module installed.', array('%module' => $module), WATCHDOG_INFO);
watchdog('system', '%module module installed.', array('%module' => $module), LOG_INFO);
}
// Enable the module.
......@@ -456,7 +456,7 @@ function module_enable($module_list, $enable_dependencies = TRUE) {
// Record the fact that it was enabled.
$modules_enabled[] = $module;
watchdog('system', '%module module enabled.', array('%module' => $module), WATCHDOG_INFO);
watchdog('system', '%module module enabled.', array('%module' => $module), LOG_INFO);
}
}
......@@ -530,7 +530,7 @@ function module_disable($module_list, $disable_dependents = TRUE) {
->condition('name', $module)
->execute();
$invoke_modules[] = $module;
watchdog('system', '%module module disabled.', array('%module' => $module), WATCHDOG_INFO);
watchdog('system', '%module module disabled.', array('%module' => $module), LOG_INFO);
}
}
......
......@@ -789,7 +789,7 @@ function theme($hook, $variables = array()) {
// Only log a message when not trying theme suggestions ($hook being an
// array).
if (!isset($candidate)) {
watchdog('theme', 'Theme key "@key" not found.', array('@key' => $hook), WATCHDOG_WARNING);
watchdog('theme', 'Theme key "@key" not found.', array('@key' => $hook), LOG_WARNING);
}
return '';
}
......
......@@ -202,7 +202,7 @@ function drupal_xml_parser_create(&$data) {
$data = preg_replace('/^(<\?xml[^>]+encoding)="(.+?)"/', '\\1="utf-8"', $out);
}
else {
watchdog('php', 'Could not convert XML encoding %s to UTF-8.', array('%s' => $encoding), WATCHDOG_WARNING);
watchdog('php', 'Could not convert XML encoding %s to UTF-8.', array('%s' => $encoding), LOG_WARNING);
return FALSE;
}
}
......@@ -236,7 +236,7 @@ function drupal_convert_to_utf8($data, $encoding) {
$out = @recode_string($encoding . '..utf-8', $data);
}
else {
watchdog('php', 'Unsupported encoding %s. Please install iconv, GNU recode or mbstring for PHP.', array('%s' => $encoding), WATCHDOG_ERROR);
watchdog('php', 'Unsupported encoding %s. Please install iconv, GNU recode or mbstring for PHP.', array('%s' => $encoding), LOG_ERR);
return FALSE;
}
......
......@@ -193,7 +193,7 @@ function aggregator_form_feed_submit($form, &$form_state) {
}
}
else {
watchdog('aggregator', 'Feed %feed added.', array('%feed' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/config/services/aggregator'));
watchdog('aggregator', 'Feed %feed added.', array('%feed' => $form_state['values']['title']), LOG_NOTICE, l(t('view'), 'admin/config/services/aggregator'));
drupal_set_message(t('The feed %feed has been added.', array('%feed' => $form_state['values']['title'])));
}
}
......@@ -591,7 +591,7 @@ function aggregator_form_category_submit($form, &$form_state) {
}
}
else {
watchdog('aggregator', 'Category %category added.', array('%category' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/config/services/aggregator'));
watchdog('aggregator', 'Category %category added.', array('%category' => $form_state['values']['title']), LOG_NOTICE, l(t('view'), 'admin/config/services/aggregator'));
drupal_set_message(t('The category %category has been added.', array('%category' => $form_state['values']['title'])));
}
}
......@@ -53,7 +53,7 @@ function aggregator_aggregator_fetch($feed) {
$feed->http_headers = $result->headers;
break;
default:
watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed->title, '%error' => $result->code . ' ' . $result->error), WATCHDOG_WARNING);
watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed->title, '%error' => $result->code . ' ' . $result->error), LOG_WARNING);
drupal_set_message(t('The feed from %site seems to be broken, because of error "%error".', array('%site' => $feed->title, '%error' => $result->code . ' ' . $result->error)));
}
......
......@@ -85,7 +85,7 @@ function aggregator_parse_feed(&$data, $feed) {
xml_set_character_data_handler($xml_parser, 'aggregator_element_data');
if (!xml_parse($xml_parser, $data, 1)) {
watchdog('aggregator', 'The feed from %site seems to be broken, due to an error "%error" on line %line.', array('%site' => $feed->title, '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)), WATCHDOG_WARNING);
watchdog('aggregator', 'The feed from %site seems to be broken, due to an error "%error" on line %line.', array('%site' => $feed->title, '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser)), LOG_WARNING);
drupal_set_message(t('The feed from %site seems to be broken, because of error "%error" on line %line.', array('%site' => $feed->title, '%error' => xml_error_string(xml_get_error_code($xml_parser)), '%line' => xml_get_current_line_number($xml_parser))), 'error');
return FALSE;
}
......
......@@ -130,7 +130,7 @@ function book_admin_edit_submit($form, &$form_state) {
$node->log = t('Title changed from %original to %current.', array('%original' => $node->title, '%current' => $values['title']));
node_save($node);
watchdog('content', 'book: updated %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
watchdog('content', 'book: updated %title.', array('%title' => $node->title), LOG_NOTICE, l(t('view'), 'node/' . $node->nid));
}
}
}
......
......@@ -2223,7 +2223,7 @@ function comment_form_submit($form, &$form_state) {
$form_state['values']['cid'] = $comment->cid;
// Add an entry to the watchdog log.
watchdog('content', 'Comment posted: %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)));
watchdog('content', 'Comment posted: %subject.', array('%subject' => $comment->subject), LOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid)));
// Explain the approval queue if necessary.
if ($comment->status == COMMENT_NOT_PUBLISHED) {
......@@ -2244,7 +2244,7 @@ function comment_form_submit($form, &$form_state) {
$redirect = array('node/' . $node->nid, array('query' => $query, 'fragment' => 'comment-' . $comment->cid));
}
else {
watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject), WATCHDOG_WARNING);
watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject), LOG_WARNING);
drupal_set_message(t('Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject)), 'error');
// Redirect the user to the node they are commenting on.
$redirect = 'node/' . $node->nid;
......
......@@ -162,7 +162,7 @@ function contact_category_edit_form_submit($form, &$form_state) {
}
drupal_set_message(t('Category %category has been saved.', array('%category' => $form_state['values']['category'])));
watchdog('contact', 'Category %category has been saved.', array('%category' => $form_state['values']['category']), WATCHDOG_NOTICE, l(t('Edit'), 'admin/structure/contact/edit/' . $form_state['values']['cid']));
watchdog('contact', 'Category %category has been saved.', array('%category' => $form_state['values']['category']), LOG_NOTICE, l(t('Edit'), 'admin/structure/contact/edit/' . $form_state['values']['cid']));
$form_state['redirect'] = 'admin/structure/contact';
}
......@@ -200,7 +200,7 @@ function contact_category_delete_form_submit($form, &$form_state) {
->execute();
drupal_set_message(t('Category %category has been deleted.', array('%category' => $contact['category'])));
watchdog('contact', 'Category %category has been deleted.', array('%category' => $contact['category']), WATCHDOG_NOTICE);
watchdog('contact', 'Category %category has been deleted.', array('%category' => $contact['category']), LOG_NOTICE);
$form_state['redirect'] = 'admin/structure/contact';
}
......@@ -15,14 +15,14 @@ function dblog_overview() {
$filter = dblog_build_filter_query();
$rows = array();
$classes = array(
WATCHDOG_DEBUG => 'dblog-debug',
WATCHDOG_INFO => 'dblog-info',
WATCHDOG_NOTICE => 'dblog-notice',
WATCHDOG_WARNING => 'dblog-warning',
WATCHDOG_ERROR => 'dblog-error',
WATCHDOG_CRITICAL => 'dblog-critical',
WATCHDOG_ALERT => 'dblog-alert',
WATCHDOG_EMERGENCY => 'dblog-emerg',
LOG_DEBUG => 'dblog-debug',
LOG_INFO => 'dblog-info',
LOG_NOTICE => 'dblog-notice',
LOG_WARNING => 'dblog-warning',
LOG_ERR => 'dblog-error',
LOG_CRIT => 'dblog-critical',
LOG_ALERT => 'dblog-alert',
LOG_EMERG => 'dblog-emerg',
);
$build['dblog_filter_form'] = drupal_get_form('dblog_filter_form');
......
......@@ -94,7 +94,7 @@ class DBLogTestCase extends DrupalWebTestCase {
* @param $severity
* The severity of the watchdog entry.
*/
private function generateLogEntries($count, $type = 'custom', $severity = WATCHDOG_NOTICE) {
private function generateLogEntries($count, $type = 'custom', $severity = LOG_NOTICE) {
global $base_root;
// Prepare the fields to be logged
......@@ -384,7 +384,7 @@ class DBLogTestCase extends DrupalWebTestCase {
'type' => 'custom',
'message' => 'Log entry added to test the doClearTest clear down.',
'variables' => array(),
'severity' => WATCHDOG_NOTICE,
'severity' => LOG_NOTICE,
'link' => NULL,
'user' => $this->big_user,
'request_uri' => $base_root . request_uri(),
......@@ -419,7 +419,7 @@ class DBLogTestCase extends DrupalWebTestCase {
$types = array();
for ($i = 0; $i < 3; $i++) {
$type_names[] = $type_name = $this->randomName();
$severity = WATCHDOG_EMERGENCY;
$severity = LOG_EMERG;
for ($j = 0; $j < 3; $j++) {
$types[] = $type = array(
'count' => mt_rand(1, 5),
......@@ -532,14 +532,14 @@ class DBLogTestCase extends DrupalWebTestCase {
protected function getSeverityConstant($class) {
// Reversed array from dblog_overview().
$map = array(
'dblog-debug' => WATCHDOG_DEBUG,
'dblog-info' => WATCHDOG_INFO,
'dblog-notice' => WATCHDOG_NOTICE,
'dblog-warning' => WATCHDOG_WARNING,
'dblog-error' => WATCHDOG_ERROR,
'dblog-critical' => WATCHDOG_CRITICAL,
'dblog-alert' => WATCHDOG_ALERT,
'dblog-emerg' => WATCHDOG_EMERGENCY,
'dblog-debug' => LOG_DEBUG,
'dblog-info' => LOG_INFO,
'dblog-notice' => LOG_NOTICE,
'dblog-warning' => LOG_WARNING,
'dblog-error' => LOG_ERR,
'dblog-critical' => LOG_CRIT,
'dblog-alert' => LOG_ALERT,
'dblog-emerg' => LOG_EMERG,
);
// Find the class that contains the severity.
......
......@@ -721,7 +721,7 @@ function check_markup($text, $format_id = NULL, $langcode = '', $cache = FALSE)
}
// If the requested text format does not exist, the text cannot be filtered.
if (!$format = filter_format_load($format_id)) {
watchdog('filter', 'Missing text format: %format.', array('%format' => $format_id), WATCHDOG_ALERT);
watchdog('filter', 'Missing text format: %format.', array('%format' => $format_id), LOG_ALERT);
return '';
}
......
......@@ -73,7 +73,7 @@ function image_image_effect_info() {
*/
function image_resize_effect(&$image, $data) {
if (!image_resize($image, $data['width'], $data['height'])) {
watchdog('image', 'Image resize failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
watchdog('image', 'Image resize failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), LOG_ERR);
return FALSE;
}
return TRUE;
......@@ -108,7 +108,7 @@ function image_scale_effect(&$image, $data) {
$data['height'] = empty($data['height']) ? PHP_INT_MAX : $data['height'];
if (!image_scale($image, $data['width'], $data['height'], $data['upscale'])) {
watchdog('image', 'Image scale failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
watchdog('image', 'Image scale failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), LOG_ERR);
return FALSE;
}
return TRUE;
......@@ -142,7 +142,7 @@ function image_crop_effect(&$image, $data) {
$x = image_filter_keyword($x, $image->info['width'], $data['width']);
$y = image_filter_keyword($y, $image->info['height'], $data['height']);
if (!image_crop($image, $x, $y, $data['width'], $data['height'])) {
watchdog('image', 'Image crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
watchdog('image', 'Image crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), LOG_ERR);
return FALSE;
}
return TRUE;
......@@ -164,7 +164,7 @@ function image_crop_effect(&$image, $data) {
*/
function image_scale_and_crop_effect(&$image, $data) {
if (!image_scale_and_crop($image, $data['width'], $data['height'])) {
watchdog('image', 'Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
watchdog('image', 'Image scale and crop failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), LOG_ERR);
return FALSE;
}
return TRUE;
......@@ -183,7 +183,7 @@ function image_scale_and_crop_effect(&$image, $data) {
*/
function image_desaturate_effect(&$image, $data) {
if (!image_desaturate($image)) {
watchdog('image', 'Image desaturate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
watchdog('image', 'Image desaturate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), LOG_ERR);
return FALSE;
}
return TRUE;
......@@ -236,7 +236,7 @@ function image_rotate_effect(&$image, $data) {
}
if (!image_rotate($image, $data['degrees'], $data['bgcolor'])) {
watchdog('image', 'Image rotate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), WATCHDOG_ERROR);
watchdog('image', 'Image rotate failed using the %toolkit toolkit on %path (%mimetype, %dimensions)', array('%toolkit' => $image->toolkit, '%path' => $image->source, '%mimetype' => $image->info['mime_type'], '%dimensions' => $image->info['width'] . 'x' . $image->info['height']), LOG_ERR);