From 696e74bedddc6e331c3a88d3d19f61c8ec23211f Mon Sep 17 00:00:00 2001 From: Bob Vincent Date: Wed, 15 Jun 2011 09:36:27 -0400 Subject: [PATCH] Issue #1136130: Revert logging level constants back to WATCHDOG_* and document why the change was made. --- authorize.php | 2 +- cron.php | 4 +- includes/actions.inc | 4 +- includes/ajax.inc | 2 +- includes/bootstrap.inc | 67 ++++++++++++++++++++- includes/common.inc | 29 +++++---- includes/errors.inc | 32 +++++----- includes/file.inc | 12 ++-- includes/form.inc | 4 +- includes/image.inc | 2 +- includes/install.inc | 2 +- includes/locale.inc | 6 +- includes/mail.inc | 2 +- includes/module.inc | 6 +- includes/theme.inc | 2 +- includes/unicode.inc | 4 +- modules/aggregator/aggregator.admin.inc | 4 +- modules/aggregator/aggregator.fetcher.inc | 2 +- modules/aggregator/aggregator.parser.inc | 2 +- modules/book/book.admin.inc | 2 +- modules/comment/comment.module | 4 +- modules/contact/contact.admin.inc | 4 +- modules/dblog/dblog.admin.inc | 16 +++--- modules/dblog/dblog.test | 22 ++++---- modules/filter/filter.module | 2 +- modules/image/image.effects.inc | 12 ++-- modules/image/image.module | 4 +- modules/locale/locale.admin.inc | 4 +- modules/menu/menu.admin.inc | 4 +- modules/node/content_types.inc | 4 +- modules/node/node.pages.inc | 4 +- modules/openid/openid.module | 6 +- modules/profile/profile.admin.inc | 4 +- modules/search/search.pages.inc | 2 +- modules/simpletest/tests/actions_loop_test.module | 2 +- modules/simpletest/tests/common.test | 2 +- modules/simpletest/tests/common_test_info.txt | 2 +- modules/system/system.api.php | 34 +++++----- modules/system/system.module | 8 +- modules/system/system.test | 10 ++-- modules/taxonomy/taxonomy.admin.inc | 14 ++-- modules/user/user.admin.inc | 2 +- modules/user/user.module | 10 ++-- modules/user/user.pages.inc | 2 +- update.php | 2 +- 45 files changed, 216 insertions(+), 154 deletions(-) diff --git a/authorize.php b/authorize.php index 97cdd70d0c260fe4fe5b40d9669aa579a7c71d1f..cd3df50e653828b78790354a560e64c4c3779762 100644 --- a/authorize.php +++ b/authorize.php @@ -39,7 +39,7 @@ define('MAINTENANCE_MODE', 'update'); */ function authorize_access_denied_page() { drupal_add_http_header('Status', '403 Forbidden'); - watchdog('access denied', 'authorize.php', NULL, LOG_WARNING); + watchdog('access denied', 'authorize.php', NULL, WATCHDOG_WARNING); drupal_set_title('Access denied'); return t('You are not allowed to access this page.'); } diff --git a/cron.php b/cron.php index 25e07b78ab09548ccfb441bb05921bb4064ffc04..c6ce5317e88fda48a6543ebcbcc09ec93e9d99ac 100644 --- a/cron.php +++ b/cron.php @@ -14,11 +14,11 @@ include_once DRUPAL_ROOT . '/includes/bootstrap.inc'; 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(), LOG_NOTICE); + watchdog('cron', 'Cron could not run because an invalid key was used.', array(), WATCHDOG_NOTICE); drupal_access_denied(); } elseif (variable_get('maintenance_mode', 0)) { - watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), LOG_NOTICE); + watchdog('cron', 'Cron could not run because the site is in maintenance mode.', array(), WATCHDOG_NOTICE); drupal_access_denied(); } else { diff --git a/includes/actions.inc b/includes/actions.inc index 5dce71e4782366e750354fae27548e103ce5470f..c2fd4d96c7ac1dd03b77b594832bb2ff4a791897 100644 --- a/includes/actions.inc +++ b/includes/actions.inc @@ -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(), LOG_ERR); + watchdog('actions', 'Stack overflow: too many calls to actions_do(). Aborting to prevent infinite recursion.', array(), WATCHDOG_ERROR); 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), LOG_WARNING); + watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_WARNING); } } } diff --git a/includes/ajax.inc b/includes/ajax.inc index ac1bd4c5d59288a828541f4e0368b192b0d73392..41c69832a8e072b5c6005c83da86d370c1fdac1c 100644 --- a/includes/ajax.inc +++ b/includes/ajax.inc @@ -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(), LOG_WARNING); + watchdog('ajax', 'Invalid form POST data.', array(), WATCHDOG_WARNING); drupal_exit(); } diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 4dad33aaf6723c815d8cbc3f22789415f82ffb2d..81f44502bfcaf4f1f4f7c758baa4baa68161d67d 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -38,6 +38,67 @@ define('CACHE_PERMANENT', 0); define('CACHE_TEMPORARY', -1); /** + * @defgroup logging_severity_levels Logging severity levels + * @{ + * Logging severity levels as defined in RFC 3164. + * + * 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 + * PHP supplies predefined LOG_* constants for use in the syslog() function, but + * their values only correspond to RFC 3164 on Unix systems, not on Windows. + * + * @see http://bugs.php.net/bug.php?id=18090 + * @see http://php.net/manual/function.syslog.php + * @see http://php.net/manual/network.constants.php + * @see watchdog() + * @see watchdog_severity_levels() + */ + +/* + * Log message severity -- Emergency: system is unusable. + */ +define('WATCHDOG_EMERGENCY', 0); + +/** + * Log message severity -- Alert: action must be taken immediately. + */ +define('WATCHDOG_ALERT', 1); + +/** + * Log message severity -- Critical: critical conditions. + */ +define('WATCHDOG_CRITICAL', 2); + +/** + * Log message severity -- Error: error conditions. + */ +define('WATCHDOG_ERROR', 3); + +/** + * Log message severity -- Warning: warning conditions. + */ +define('WATCHDOG_WARNING', 4); + +/** + * Log message severity -- Notice: normal but significant condition. + */ +define('WATCHDOG_NOTICE', 5); + +/** + * Log message severity -- Informational: informational messages. + */ +define('WATCHDOG_INFO', 6); + +/** + * Log message severity -- Debug: debug-level messages. + */ +define('WATCHDOG_DEBUG', 7); + +/** + * @} End of "defgroup logging_severity_levels". + */ + +/** * First bootstrap phase: initialize configuration. */ define('DRUPAL_BOOTSTRAP_CONFIGURATION', 0); @@ -1348,7 +1409,7 @@ function request_uri() { * @see watchdog() * @see drupal_decode_exception() */ -function watchdog_exception($type, Exception $exception, $message = NULL, $variables = array(), $severity = LOG_ERR, $link = NULL) { +function watchdog_exception($type, Exception $exception, $message = NULL, $variables = array(), $severity = WATCHDOG_ERROR, $link = NULL) { // Use a default value if $message is not set. if (empty($message)) { @@ -1383,14 +1444,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 - * LOG_ERR, LOG_WARNING, etc. + * WATCHDOG_ERROR, WATCHDOG_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 = LOG_NOTICE, $link = NULL) { +function watchdog($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) { global $user, $base_root; static $in_error_state = FALSE; diff --git a/includes/common.inc b/includes/common.inc index 4ec37dc44410264ed2d114ccd1e7a7ff8f5eee2d..a5228ec6e496cbb0ba343b05d399e9cb89734ed7 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -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']), LOG_ERR); + watchdog('delivery callback not found', 'callback %callback not found: %q.', array('%callback' => $delivery_callback, '%q' => $_GET['q']), WATCHDOG_ERROR); } } @@ -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, LOG_WARNING); + watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_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, LOG_WARNING); + watchdog('access denied', check_plain($_GET['q']), NULL, WATCHDOG_WARNING); // Keep old path for reference, and to allow forms to redirect to it. if (!isset($_GET['destination'])) { @@ -5025,7 +5025,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(), LOG_WARNING); + watchdog('cron', 'Attempting to re-run cron while it is already running.', array(), WATCHDOG_WARNING); } else { // Make sure every queue exists. There is no harm in trying to recreate an @@ -5041,7 +5041,7 @@ function drupal_cron_run() { // Record cron time variable_set('cron_last', REQUEST_TIME); - watchdog('cron', 'Cron run completed.', array(), LOG_NOTICE); + watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE); // Release cron lock. lock_release('cron'); @@ -5072,7 +5072,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(), LOG_WARNING); + watchdog('cron', 'Cron run exceeded the time limit and was aborted.', array(), WATCHDOG_WARNING); // Release cron semaphore variable_del('cron_semaphore'); @@ -7045,17 +7045,18 @@ function drupal_parse_info_format($data) { * Array of the possible severity levels for log messages. * * @see watchdog() + * @ingroup logging_severity_levels */ function watchdog_severity_levels() { return array( - 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'), + WATCHDOG_EMERG => t('emergency'), + WATCHDOG_ALERT => t('alert'), + WATCHDOG_CRIT => t('critical'), + WATCHDOG_ERROR => t('error'), + WATCHDOG_WARNING => t('warning'), + WATCHDOG_NOTICE => t('notice'), + WATCHDOG_INFO => t('info'), + WATCHDOG_DEBUG => t('debug'), ); } diff --git a/includes/errors.inc b/includes/errors.inc index 62d42016604f1ee10574d00149d81b89d13b1701..121e069a50aca3dd6f13b174b1fed95aa35e8f37 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -27,21 +27,21 @@ define('ERROR_REPORTING_DISPLAY_ALL', 2); */ function drupal_error_levels() { $types = array( - 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 => array('Deprecated function', LOG_DEBUG), - E_USER_DEPRECATED => array('User deprecated function', LOG_DEBUG), + 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_DEPRECATED => array('Deprecated function', WATCHDOG_DEBUG), + E_USER_DEPRECATED => array('User deprecated function', WATCHDOG_DEBUG), ); return $types; @@ -127,7 +127,7 @@ function _drupal_decode_exception($exception) { '%function' => $caller['function'], '%file' => $caller['file'], '%line' => $caller['line'], - 'severity_level' => LOG_ERR, + 'severity_level' => WATCHDOG_ERROR, ); } diff --git a/includes/file.inc b/includes/file.inc index 4750ff481fe297ea9581782b1f71ba9207d8043c..5452aaef7dbfde5f13e869c17a6d4bd4a733ec82 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -507,7 +507,7 @@ function file_create_htaccess($directory, $private = TRUE) { } else { $variables = array('%directory' => $directory, '!htaccess' => '
' . 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: !htaccess", $variables, LOG_ERR); + watchdog('security', "Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: !htaccess", $variables, WATCHDOG_ERROR); } } @@ -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)), LOG_ERR); + watchdog('file', 'The specified file %file could not be copied to %destination.', array('%file' => $source, '%destination' => drupal_realpath($destination)), WATCHDOG_ERROR); 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), LOG_ERR); + watchdog('file', '%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path), WATCHDOG_ERROR); 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), LOG_NOTICE); + watchdog('file', 'The file %path was not deleted, because it does not exist.', array('%path' => $path), WATCHDOG_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), LOG_ERR); + watchdog('file', 'The file %path is not of a recognized type so it was not deleted.', array('%path' => $path), WATCHDOG_ERROR); 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), LOG_ERR); + watchdog('file', 'The file permissions could not be set on %uri.', array('%uri' => $uri), WATCHDOG_ERROR); return FALSE; } diff --git a/includes/form.inc b/includes/form.inc index 8f2ee2632eaa8c47797229a31f51afd58e18679d..b024918a3711623315ce01cb915c2302bb7a62e8 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -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']), LOG_ERR); + watchdog('form', 'Illegal choice %choice in !name element.', array('%choice' => $v, '!name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), WATCHDOG_ERROR); } } } @@ -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']), LOG_ERR); + watchdog('form', 'Illegal choice %choice in %name element.', array('%choice' => $elements['#value'], '%name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title']), WATCHDOG_ERROR); } } } diff --git a/includes/image.inc b/includes/image.inc index 9f8cd55933160776fc50deaa62280577d75eca5d..b04943b5e619debb30387c3743e91425c8064b20 100644 --- a/includes/image.inc +++ b/includes/image.inc @@ -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), LOG_ERR); + watchdog('image', 'The selected image handling toolkit %toolkit can not correctly process %function.', array('%toolkit' => $image->toolkit, '%function' => $function), WATCHDOG_ERROR); return FALSE; } diff --git a/includes/install.inc b/includes/install.inc index 3634660e01c510a8fa61d089fd53d37075cf27b9..089cdee8f56b4a1bcae4dd6a07ffc6b3e8f2b4ce 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -787,7 +787,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), LOG_INFO); + watchdog('system', '%module module uninstalled.', array('%module' => $module), WATCHDOG_INFO); drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED); } diff --git a/includes/locale.inc b/includes/locale.inc index 3fb4707d2553d679b263afc538adc182c05efbab..6154cf3c355ce9e9c2e53b2761089ed86c846746 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -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), LOG_WARNING); + watchdog('locale', '@count disallowed HTML string(s) in %file', array('@count' => $skips, '%file' => $file->uri), WATCHDOG_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), LOG_WARNING); + watchdog('locale', 'JavaScript translation file %file.js was lost.', array('%file' => $language->javascript), WATCHDOG_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)), LOG_ERR); + watchdog('locale', 'An error occurred during creation of the JavaScript translation file for the language %language.', array('%language' => t($language->name)), WATCHDOG_ERROR); return FALSE; default: // No operation needed. diff --git a/includes/mail.inc b/includes/mail.inc index be2df923427ec363f671132771e9c97ee490c090..d2febed39686c9bf3f6f7a2bf99fa1377d09f4de 100644 --- a/includes/mail.inc +++ b/includes/mail.inc @@ -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']), LOG_ERR); + watchdog('mail', 'Error sending e-mail (from %from to %to).', array('%from' => $message['from'], '%to' => $message['to']), WATCHDOG_ERROR); drupal_set_message(t('Unable to send e-mail. Contact the site administrator if the problem persists.'), 'error'); } } diff --git a/includes/module.inc b/includes/module.inc index 23f2fa810ff9569c08513380364fb4ed9fe97903..779b668269eb69e7c0cd4a14915242248b67c3fe 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -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), LOG_INFO); + watchdog('system', '%module module installed.', array('%module' => $module), WATCHDOG_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), LOG_INFO); + watchdog('system', '%module module enabled.', array('%module' => $module), WATCHDOG_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), LOG_INFO); + watchdog('system', '%module module disabled.', array('%module' => $module), WATCHDOG_INFO); } } diff --git a/includes/theme.inc b/includes/theme.inc index c2112489b9008b33589d9007bd17e7d9eff4e8a6..3ae50006aa31fdb28c826e670121a665d41f5ef4 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -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), LOG_WARNING); + watchdog('theme', 'Theme key "@key" not found.', array('@key' => $hook), WATCHDOG_WARNING); } return ''; } diff --git a/includes/unicode.inc b/includes/unicode.inc index df9186824e7329202587fb9136821207eb9878d9..9dde2ca70cca8fc8f1710b9ee88cd0ca01fc2a80 100644 --- a/includes/unicode.inc +++ b/includes/unicode.inc @@ -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), LOG_WARNING); + watchdog('php', 'Could not convert XML encoding %s to UTF-8.', array('%s' => $encoding), WATCHDOG_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), LOG_ERR); + watchdog('php', 'Unsupported encoding %s. Please install iconv, GNU recode or mbstring for PHP.', array('%s' => $encoding), WATCHDOG_ERROR); return FALSE; } diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc index d9039e08ae0379aacc3b687f99caaeb1c184f843..08087afb2b868d2dde47fadc0d63a3ffbcb35bbc 100644 --- a/modules/aggregator/aggregator.admin.inc +++ b/modules/aggregator/aggregator.admin.inc @@ -193,7 +193,7 @@ function aggregator_form_feed_submit($form, &$form_state) { } } else { - watchdog('aggregator', 'Feed %feed added.', array('%feed' => $form_state['values']['title']), LOG_NOTICE, l(t('view'), 'admin/config/services/aggregator')); + watchdog('aggregator', 'Feed %feed added.', array('%feed' => $form_state['values']['title']), WATCHDOG_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']), LOG_NOTICE, l(t('view'), 'admin/config/services/aggregator')); + watchdog('aggregator', 'Category %category added.', array('%category' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/config/services/aggregator')); drupal_set_message(t('The category %category has been added.', array('%category' => $form_state['values']['title']))); } } diff --git a/modules/aggregator/aggregator.fetcher.inc b/modules/aggregator/aggregator.fetcher.inc index 9f15177e808f40f2aed912ea241358f02166a024..0f728779864f9c28111dff7f2bbd48c5ad3abca6 100644 --- a/modules/aggregator/aggregator.fetcher.inc +++ b/modules/aggregator/aggregator.fetcher.inc @@ -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), LOG_WARNING); + watchdog('aggregator', 'The feed from %site seems to be broken, due to "%error".', array('%site' => $feed->title, '%error' => $result->code . ' ' . $result->error), WATCHDOG_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))); } diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc index d9b3108f4b0dec0e62f44316d92949a2be437b9a..cffd1c3aa49a2a5dc4815e682c7b2b79dc6ab35a 100644 --- a/modules/aggregator/aggregator.parser.inc +++ b/modules/aggregator/aggregator.parser.inc @@ -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)), LOG_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)), WATCHDOG_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; } diff --git a/modules/book/book.admin.inc b/modules/book/book.admin.inc index 58fd4f9dc5da4ec82704cd1f3d478e3684841c11..7b9dea390f5bdc9c66d018b889d41c6d5368bf10 100644 --- a/modules/book/book.admin.inc +++ b/modules/book/book.admin.inc @@ -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), LOG_NOTICE, l(t('view'), 'node/' . $node->nid)); + watchdog('content', 'book: updated %title.', array('%title' => $node->title), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid)); } } } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 60a9ca40aabfb825fb43410d4799d1ea51d0f484..4a737557d986eb96752ae1ae3efbdfc3b550ce96 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -2202,7 +2202,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), LOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid))); + watchdog('content', 'Comment posted: %subject.', array('%subject' => $comment->subject), WATCHDOG_NOTICE, l(t('view'), 'comment/' . $comment->cid, array('fragment' => 'comment-' . $comment->cid))); // Explain the approval queue if necessary. if ($comment->status == COMMENT_NOT_PUBLISHED) { @@ -2223,7 +2223,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), LOG_WARNING); + watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject), WATCHDOG_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; diff --git a/modules/contact/contact.admin.inc b/modules/contact/contact.admin.inc index bc555c487d699f865bb252f0a24f2301535f052f..9fde037d3454c7ccecea41c69bdd6ac795725b48 100644 --- a/modules/contact/contact.admin.inc +++ b/modules/contact/contact.admin.inc @@ -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']), LOG_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']), WATCHDOG_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']), LOG_NOTICE); + watchdog('contact', 'Category %category has been deleted.', array('%category' => $contact['category']), WATCHDOG_NOTICE); $form_state['redirect'] = 'admin/structure/contact'; } diff --git a/modules/dblog/dblog.admin.inc b/modules/dblog/dblog.admin.inc index ef8f93506a05208300370ef1c175e6b2987add8b..942f6b845d02f0f137ce1c0872f56fbd4bcaa38d 100644 --- a/modules/dblog/dblog.admin.inc +++ b/modules/dblog/dblog.admin.inc @@ -15,14 +15,14 @@ function dblog_overview() { $filter = dblog_build_filter_query(); $rows = array(); $classes = array( - 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', + WATCHDOG_DEBUG => 'dblog-debug', + WATCHDOG_INFO => 'dblog-info', + WATCHDOG_NOTICE => 'dblog-notice', + WATCHDOG_WARNING => 'dblog-warning', + WATCHDOG_ERROR => 'dblog-error', + WATCHDOG_CRIT => 'dblog-critical', + WATCHDOG_ALERT => 'dblog-alert', + WATCHDOG_EMERG => 'dblog-emerg', ); $build['dblog_filter_form'] = drupal_get_form('dblog_filter_form'); diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test index d2781ebb1364bb9e5953461e0b97390c0e454353..3e6e3da84b183387cdda51c729f0d1442fbb23f3 100644 --- a/modules/dblog/dblog.test +++ b/modules/dblog/dblog.test @@ -94,7 +94,7 @@ class DBLogTestCase extends DrupalWebTestCase { * @param $severity * The severity of the watchdog entry. */ - private function generateLogEntries($count, $type = 'custom', $severity = LOG_NOTICE) { + private function generateLogEntries($count, $type = 'custom', $severity = WATCHDOG_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' => LOG_NOTICE, + 'severity' => WATCHDOG_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 = LOG_EMERG; + $severity = WATCHDOG_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' => 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, + 'dblog-debug' => WATCHDOG_DEBUG, + 'dblog-info' => WATCHDOG_INFO, + 'dblog-notice' => WATCHDOG_NOTICE, + 'dblog-warning' => WATCHDOG_WARNING, + 'dblog-error' => WATCHDOG_ERROR, + 'dblog-critical' => WATCHDOG_CRIT, + 'dblog-alert' => WATCHDOG_ALERT, + 'dblog-emerg' => WATCHDOG_EMERG, ); // Find the class that contains the severity. diff --git a/modules/filter/filter.module b/modules/filter/filter.module index 773fa80be74ed8f6d4c9c166547b164c4784c253..66fadcba74f2d8650c4da08f76929ef9d0feb7e8 100644 --- a/modules/filter/filter.module +++ b/modules/filter/filter.module @@ -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), LOG_ALERT); + watchdog('filter', 'Missing text format: %format.', array('%format' => $format_id), WATCHDOG_ALERT); return ''; } diff --git a/modules/image/image.effects.inc b/modules/image/image.effects.inc index 6120f9cdc7ba61d1efc81aa6ea97fd6135ef1255..122af6c44f15eebfaa600fda46fdb7fe9e80b926 100644 --- a/modules/image/image.effects.inc +++ b/modules/image/image.effects.inc @@ -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']), LOG_ERR); + 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); 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']), LOG_ERR); + 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); 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']), LOG_ERR); + 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); 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']), LOG_ERR); + 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); 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']), LOG_ERR); + 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); 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']), LOG_ERR); + 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); return FALSE; } return TRUE; diff --git a/modules/image/image.module b/modules/image/image.module index 6ef43ada8b74fab187aaa0e1aa8d797a8cc27e1a..008a36513a943e5538aaffc93fac60c6bf2cb52f 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -789,7 +789,7 @@ function image_style_create_derivative($style, $source, $destination) { // Build the destination folder tree if it doesn't already exist. if (!file_prepare_directory($directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS)) { - watchdog('image', 'Failed to create style directory: %directory', array('%directory' => $directory), LOG_ERR); + watchdog('image', 'Failed to create style directory: %directory', array('%directory' => $directory), WATCHDOG_ERROR); return FALSE; } @@ -803,7 +803,7 @@ function image_style_create_derivative($style, $source, $destination) { if (!image_save($image, $destination)) { if (file_exists($destination)) { - watchdog('image', 'Cached image file %destination already exists. There may be an issue with your rewrite configuration.', array('%destination' => $destination), LOG_ERR); + watchdog('image', 'Cached image file %destination already exists. There may be an issue with your rewrite configuration.', array('%destination' => $destination), WATCHDOG_ERROR); } return FALSE; } diff --git a/modules/locale/locale.admin.inc b/modules/locale/locale.admin.inc index dff6537d8d4728f8432a4ea5091a1f87e31a5a6f..d8201dbf227bd7cb06799470c951402cf86e80f2 100644 --- a/modules/locale/locale.admin.inc +++ b/modules/locale/locale.admin.inc @@ -990,7 +990,7 @@ function locale_translate_import_form_submit($form, &$form_state) { if ($return = _locale_import_po($file, $langcode, $form_state['values']['mode'], $form_state['values']['group']) == FALSE) { $variables = array('%filename' => $file->filename); drupal_set_message(t('The translation import of %filename failed.', $variables), 'error'); - watchdog('locale', 'The translation import of %filename failed.', $variables, LOG_ERR); + watchdog('locale', 'The translation import of %filename failed.', $variables, WATCHDOG_ERROR); } } else { @@ -1169,7 +1169,7 @@ function locale_translate_edit_form_validate($form, &$form_state) { foreach ($form_state['values']['translations'] as $key => $value) { if ($safe_check_needed && !locale_string_is_safe($value)) { form_set_error('translations', t('The submitted string contains disallowed HTML: %string', array('%string' => $value))); - watchdog('locale', 'Attempted submission of a translation string with disallowed HTML: %string', array('%string' => $value), LOG_WARNING); + watchdog('locale', 'Attempted submission of a translation string with disallowed HTML: %string', array('%string' => $value), WATCHDOG_WARNING); } } } diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc index ec073e5b803ec96cfbb6ea75479c45773ca102a0..7b5882c530189fc7813d520aa30368246d313892 100644 --- a/modules/menu/menu.admin.inc +++ b/modules/menu/menu.admin.inc @@ -545,7 +545,7 @@ function menu_delete_menu_confirm_submit($form, &$form_state) { $t_args = array('%title' => $menu['title']); drupal_set_message(t('The custom menu %title has been deleted.', $t_args)); - watchdog('menu', 'Deleted custom menu %title and all its menu links.', $t_args, LOG_NOTICE); + watchdog('menu', 'Deleted custom menu %title and all its menu links.', $t_args, WATCHDOG_NOTICE); } /** @@ -627,7 +627,7 @@ function menu_item_delete_form_submit($form, &$form_state) { menu_link_delete($item['mlid']); $t_args = array('%title' => $item['link_title']); drupal_set_message(t('The menu link %title has been deleted.', $t_args)); - watchdog('menu', 'Deleted menu link %title.', $t_args, LOG_NOTICE); + watchdog('menu', 'Deleted menu link %title.', $t_args, WATCHDOG_NOTICE); $form_state['redirect'] = 'admin/structure/menu/manage/' . $item['menu_name']; } diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index cadabca6b184870927794a86edcee33759d0c325..d58bc318f378ebab87b88e2cd846f843196ead4e 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -354,7 +354,7 @@ function node_type_form_submit($form, &$form_state) { elseif ($status == SAVED_NEW) { node_add_body_field($type); drupal_set_message(t('The content type %name has been added.', $t_args)); - watchdog('node', 'Added content type %name.', $t_args, LOG_NOTICE, l(t('view'), 'admin/structure/types')); + watchdog('node', 'Added content type %name.', $t_args, WATCHDOG_NOTICE, l(t('view'), 'admin/structure/types')); } $form_state['redirect'] = 'admin/structure/types'; @@ -437,7 +437,7 @@ function node_type_delete_confirm_submit($form, &$form_state) { variable_del('node_preview_' . $form_state['values']['type']); $t_args = array('%name' => $form_state['values']['name']); drupal_set_message(t('The content type %name has been deleted.', $t_args)); - watchdog('menu', 'Deleted content type %name.', $t_args, LOG_NOTICE); + watchdog('menu', 'Deleted content type %name.', $t_args, WATCHDOG_NOTICE); node_types_rebuild(); menu_rebuild(); diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 5879963b5eb580fefff216ae8dd1f829c6e44864..facc7f6ee50e05fa9bbcc5841b86bd02db43e180 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -409,11 +409,11 @@ function node_form_submit($form, &$form_state) { $t_args = array('@type' => node_type_get_name($node), '%title' => $node->title); if ($insert) { - watchdog('content', '@type: added %title.', $watchdog_args, LOG_NOTICE, $node_link); + watchdog('content', '@type: added %title.', $watchdog_args, WATCHDOG_NOTICE, $node_link); drupal_set_message(t('@type %title has been created.', $t_args)); } else { - watchdog('content', '@type: updated %title.', $watchdog_args, LOG_NOTICE, $node_link); + watchdog('content', '@type: updated %title.', $watchdog_args, WATCHDOG_NOTICE, $node_link); drupal_set_message(t('@type %title has been updated.', $t_args)); } if ($node->nid) { diff --git a/modules/openid/openid.module b/modules/openid/openid.module index e3128665a0e36a38f87608f306f7376ac5723df2..b199876558f59a927eec02b1d6993e879accd9bb 100644 --- a/modules/openid/openid.module +++ b/modules/openid/openid.module @@ -866,7 +866,7 @@ function openid_verify_assertion_nonce($service, $response) { $nonce_timestamp = gmmktime($hour, $minutes, $seconds, $month, $day, $year); } else { - watchdog('openid', 'Nonce from @endpoint rejected because it is not correctly formatted, nonce: @nonce.', array('@endpoint' => $service['uri'], '@nonce' => $response['openid.response_nonce']), LOG_WARNING); + watchdog('openid', 'Nonce from @endpoint rejected because it is not correctly formatted, nonce: @nonce.', array('@endpoint' => $service['uri'], '@nonce' => $response['openid.response_nonce']), WATCHDOG_WARNING); return FALSE; } @@ -875,7 +875,7 @@ function openid_verify_assertion_nonce($service, $response) { $time = time(); $expiry = 900; if ($nonce_timestamp <= $time - $expiry || $nonce_timestamp >= $time + $expiry) { - watchdog('openid', 'Nonce received from @endpoint is out of range (time difference: @intervals). Check possible clock skew.', array('@endpoint' => $service['uri'], '@interval' => $time - $nonce_timestamp), LOG_WARNING); + watchdog('openid', 'Nonce received from @endpoint is out of range (time difference: @intervals). Check possible clock skew.', array('@endpoint' => $service['uri'], '@interval' => $time - $nonce_timestamp), WATCHDOG_WARNING); return FALSE; } @@ -898,7 +898,7 @@ function openid_verify_assertion_nonce($service, $response) { return TRUE; } else { - watchdog('openid', 'Nonce replay attempt blocked from @ip, nonce: @nonce.', array('@ip' => ip_address(), '@nonce' => $response['openid.response_nonce']), LOG_CRIT); + watchdog('openid', 'Nonce replay attempt blocked from @ip, nonce: @nonce.', array('@ip' => ip_address(), '@nonce' => $response['openid.response_nonce']), WATCHDOG_CRIT); return FALSE; } } diff --git a/modules/profile/profile.admin.inc b/modules/profile/profile.admin.inc index 622a96c41b9b8b37dcc1d0fc5a19e7b83fc23a8c..d6ac3c310fa06e081067a86c16ff5ba8f7e6f49d 100644 --- a/modules/profile/profile.admin.inc +++ b/modules/profile/profile.admin.inc @@ -374,7 +374,7 @@ function profile_field_form_submit($form, &$form_state) { ->fields($values) ->execute(); drupal_set_message(t('The field has been created.')); - watchdog('profile', 'Profile field %field added under category %category.', array('%field' => $form_state['values']['title'], '%category' => $form_state['values']['category']), LOG_NOTICE, l(t('view'), 'admin/config/people/profile')); + watchdog('profile', 'Profile field %field added under category %category.', array('%field' => $form_state['values']['title'], '%category' => $form_state['values']['category']), WATCHDOG_NOTICE, l(t('view'), 'admin/config/people/profile')); } else { db_update('profile_field') @@ -422,7 +422,7 @@ function profile_field_delete_submit($form, &$form_state) { cache_clear_all(); drupal_set_message(t('The field %field has been deleted.', array('%field' => $form_state['values']['title']))); - watchdog('profile', 'Profile field %field deleted.', array('%field' => $form_state['values']['title']), LOG_NOTICE, l(t('view'), 'admin/config/people/profile')); + watchdog('profile', 'Profile field %field deleted.', array('%field' => $form_state['values']['title']), WATCHDOG_NOTICE, l(t('view'), 'admin/config/people/profile')); $form_state['redirect'] = 'admin/config/people/profile'; return; diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc index ebf8f60dbbeb582da94f4fba35251b39ee0e30a6..833ea8bccd5373f1f35400108c328d15f36bc463 100644 --- a/modules/search/search.pages.inc +++ b/modules/search/search.pages.inc @@ -59,7 +59,7 @@ function search_view($module = NULL, $keys = '') { // Only search if there are keywords or non-empty conditions. if ($keys || !empty($conditions)) { // Log the search keys. - watchdog('search', 'Searched %type for %keys.', array('%keys' => $keys, '%type' => $info['title']), LOG_NOTICE, l(t('results'), 'search/' . $info['path'] . '/' . $keys)); + watchdog('search', 'Searched %type for %keys.', array('%keys' => $keys, '%type' => $info['title']), WATCHDOG_NOTICE, l(t('results'), 'search/' . $info['path'] . '/' . $keys)); // Collect the search results. $results = search_data($keys, $info['module'], $conditions); diff --git a/modules/simpletest/tests/actions_loop_test.module b/modules/simpletest/tests/actions_loop_test.module index afc5a260f47636657774b92e68342d95eb3385b7..77764907b9e6d6204c8c5221a4f5fd6f24dc8ee4 100644 --- a/modules/simpletest/tests/actions_loop_test.module +++ b/modules/simpletest/tests/actions_loop_test.module @@ -70,7 +70,7 @@ function actions_loop_test_log() { * Replacement of the watchdog() function that eliminates the use of semaphores * so that we can test the abortion of an action loop. */ -function watchdog_skip_semaphore($type, $message, $variables = array(), $severity = LOG_NOTICE, $link = NULL) { +function watchdog_skip_semaphore($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) { global $user, $base_root; // Prepare the fields to be logged diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test index 6cee722b98bcff681a3ccee85252273c9a415182..d618ddb00bb5a679a0cd2bff305609b0f3e806df 100644 --- a/modules/simpletest/tests/common.test +++ b/modules/simpletest/tests/common.test @@ -2066,7 +2066,7 @@ class ParseInfoFilesTestCase extends DrupalWebTestCase { function testParseInfoFile() { $info_values = drupal_parse_info_file(drupal_get_path('module', 'simpletest') . '/tests/common_test_info.txt'); $this->assertEqual($info_values['simple_string'], 'A simple string', t('Simple string value was parsed correctly.'), t('System')); - $this->assertEqual($info_values['simple_constant'], LOG_INFO, t('Constant value was parsed correctly.'), t('System')); + $this->assertEqual($info_values['simple_constant'], WATCHDOG_INFO, t('Constant value was parsed correctly.'), t('System')); $this->assertEqual($info_values['double_colon'], 'dummyClassName::', t('Value containing double-colon was parsed correctly.'), t('System')); } } diff --git a/modules/simpletest/tests/common_test_info.txt b/modules/simpletest/tests/common_test_info.txt index e3d85a13ffd06825ad25544ec4bee0e36be94efb..ae217b917036b93c0b0fc7e5727eed210294901f 100644 --- a/modules/simpletest/tests/common_test_info.txt +++ b/modules/simpletest/tests/common_test_info.txt @@ -2,7 +2,7 @@ simple_string = A simple string ; Test that constants can be used as values. -simple_constant = LOG_INFO +simple_constant = WATCHDOG_INFO ; After parsing the .info file, 'double_colon' should hold the literal value. ; Parsing should not throw a fatal error or try to access a class constant. diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 62c6a28efb132782fa39e862b4c216baf730a7c7..97d78caa3d5e410c953678b6b388e5e9696be3d7 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -2211,21 +2211,21 @@ function hook_xmlrpc_alter(&$methods) { * @param $log_entry * An associative array containing the following keys: * - type: The type of message for this entry. For contributed modules, this is - * normally the module name. Do not use 'debug', use severity LOG_DEBUG instead. + * normally the module name. Do not use 'debug', use severity WATCHDOG_DEBUG instead. * - user: The user object for the user who was logged in when the event happened. * - request_uri: The Request URI for the page the event happened in. * - referer: The page that referred the use to the page where the event occurred. * - ip: The IP address where the request for the page came from. * - timestamp: The UNIX timestamp of the date/time the event occurred * - severity: One of the following values as defined in RFC 3164 http://www.faqs.org/rfcs/rfc3164.html - * LOG_EMERG Emergency: system is unusable - * LOG_ALERT Alert: action must be taken immediately - * LOG_CRIT Critical: critical conditions - * LOG_ERR Error: error conditions - * LOG_WARNING Warning: warning conditions - * LOG_NOTICE Notice: normal but significant condition - * LOG_INFO Informational: informational messages - * LOG_DEBUG Debug: debug-level messages + * WATCHDOG_EMERG Emergency: system is unusable + * WATCHDOG_ALERT Alert: action must be taken immediately + * WATCHDOG_CRIT Critical: critical conditions + * WATCHDOG_ERROR Error: error conditions + * WATCHDOG_WARNING Warning: warning conditions + * WATCHDOG_NOTICE Notice: normal but significant condition + * WATCHDOG_INFO Informational: informational messages + * WATCHDOG_DEBUG Debug: debug-level messages * - link: an optional link provided by the module that called the watchdog() function. * - message: The text of the message to be logged. */ @@ -2233,14 +2233,14 @@ function hook_watchdog(array $log_entry) { global $base_url, $language; $severity_list = array( - LOG_EMERG => t('Emergency'), - LOG_ALERT => t('Alert'), - LOG_CRITI => t('Critical'), - LOG_ERR => t('Error'), - LOG_WARNING => t('Warning'), - LOG_NOTICE => t('Notice'), - LOG_INFO => t('Info'), - LOG_DEBUG => t('Debug'), + WATCHDOG_EMERG => t('Emergency'), + WATCHDOG_ALERT => t('Alert'), + WATCHDOG_CRITI => t('Critical'), + WATCHDOG_ERROR => t('Error'), + WATCHDOG_WARNING => t('Warning'), + WATCHDOG_NOTICE => t('Notice'), + WATCHDOG_INFO => t('Info'), + WATCHDOG_DEBUG => t('Debug'), ); $to = 'someone@example.com'; diff --git a/modules/system/system.module b/modules/system/system.module index 3ebc65706702b56310fc9b9916f96b8dad9decae..21b23f4c223ecf3e7fd2a53a2dd348b67110a320 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2145,13 +2145,13 @@ function system_check_directory($form_element) { if (!is_dir($directory) && !drupal_mkdir($directory, NULL, TRUE)) { // If the directory does not exists and cannot be created. form_set_error($form_element['#parents'][0], t('The directory %directory does not exist and could not be created.', array('%directory' => $directory))); - watchdog('file system', 'The directory %directory does not exist and could not be created.', array('%directory' => $directory), LOG_ERR); + watchdog('file system', 'The directory %directory does not exist and could not be created.', array('%directory' => $directory), WATCHDOG_ERROR); } if (is_dir($directory) && !is_writable($directory) && !drupal_chmod($directory)) { // If the directory is not writable and cannot be made so. form_set_error($form_element['#parents'][0], t('The directory %directory exists but is not writable and could not be made writable.', array('%directory' => $directory))); - watchdog('file system', 'The directory %directory exists but is not writable and could not be made writable.', array('%directory' => $directory), LOG_ERR); + watchdog('file system', 'The directory %directory exists but is not writable and could not be made writable.', array('%directory' => $directory), WATCHDOG_ERROR); } elseif (is_dir($directory)) { if ($form_element['#name'] == 'file_public_path') { @@ -2987,11 +2987,11 @@ function system_cron() { $references = file_usage_list($file); if (empty($references)) { if (!file_delete($file)) { - watchdog('file system', 'Could not delete temporary file "%path" during garbage collection', array('%path' => $file->uri), LOG_ERR); + watchdog('file system', 'Could not delete temporary file "%path" during garbage collection', array('%path' => $file->uri), WATCHDOG_ERROR); } } else { - watchdog('file system', 'Did not delete temporary file "%path" during garbage collection, because it is in use by the following modules: %modules.', array('%path' => $file->uri, '%modules' => implode(', ', array_keys($references))), LOG_INFO); + watchdog('file system', 'Did not delete temporary file "%path" during garbage collection, because it is in use by the following modules: %modules.', array('%path' => $file->uri, '%modules' => implode(', ', array_keys($references))), WATCHDOG_INFO); } } } diff --git a/modules/system/system.test b/modules/system/system.test index 59c632a46322c4479d0223f252aae1693e9846ad..77631941608b365edff1405a12278f1f49a18d4f 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -112,7 +112,7 @@ class ModuleTestCase extends DrupalWebTestCase { * @param $link * A link to associate with the message. */ - function assertLogMessage($type, $message, $variables = array(), $severity = LOG_NOTICE, $link = '') { + function assertLogMessage($type, $message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = '') { $count = db_select('watchdog', 'w') ->condition('type', $type) ->condition('message', $message) @@ -213,8 +213,8 @@ class EnableDisableTestCase extends ModuleTestCase { $this->assertText(t('hook_modules_enabled fired for @module', array('@module' => $module_to_enable))); $this->assertModules(array($module_to_enable), TRUE); $this->assertModuleTablesExist($module_to_enable); - $this->assertLogMessage('system', "%module module installed.", array('%module' => $module_to_enable), LOG_INFO); - $this->assertLogMessage('system', "%module module enabled.", array('%module' => $module_to_enable), LOG_INFO); + $this->assertLogMessage('system', "%module module installed.", array('%module' => $module_to_enable), WATCHDOG_INFO); + $this->assertLogMessage('system', "%module module enabled.", array('%module' => $module_to_enable), WATCHDOG_INFO); } // Disable and uninstall the original module, and check appropriate @@ -301,7 +301,7 @@ class EnableDisableTestCase extends ModuleTestCase { // Check that the appropriate hook was fired and the appropriate log // message appears. $this->assertText(t('hook_modules_disabled fired for @module', array('@module' => $module))); - $this->assertLogMessage('system', "%module module disabled.", array('%module' => $module), LOG_INFO); + $this->assertLogMessage('system', "%module module disabled.", array('%module' => $module), WATCHDOG_INFO); // Check that the module's database tables still exist. $this->assertModuleTablesExist($module); @@ -320,7 +320,7 @@ class EnableDisableTestCase extends ModuleTestCase { // anymore.) $this->assertText(t('hook_modules_uninstalled fired for @module', array('@module' => $module))); if ($module != 'dblog') { - $this->assertLogMessage('system', "%module module uninstalled.", array('%module' => $module), LOG_INFO); + $this->assertLogMessage('system', "%module module uninstalled.", array('%module' => $module), WATCHDOG_INFO); } // Check that the module's database tables no longer exist. diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index 74a362d164e0642d2ab42ed9e0a6e7263ad33ba7..d83f5d367536532fd6e762ab5db1f6d10044c8e8 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -222,12 +222,12 @@ function taxonomy_form_vocabulary_submit($form, &$form_state) { switch (taxonomy_vocabulary_save($vocabulary)) { case SAVED_NEW: drupal_set_message(t('Created new vocabulary %name.', array('%name' => $vocabulary->name))); - watchdog('taxonomy', 'Created new vocabulary %name.', array('%name' => $vocabulary->name), LOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/' . $vocabulary->machine_name . '/edit')); + watchdog('taxonomy', 'Created new vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/' . $vocabulary->machine_name . '/edit')); break; case SAVED_UPDATED: drupal_set_message(t('Updated vocabulary %name.', array('%name' => $vocabulary->name))); - watchdog('taxonomy', 'Updated vocabulary %name.', array('%name' => $vocabulary->name), LOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/' . $vocabulary->machine_name . '/edit')); + watchdog('taxonomy', 'Updated vocabulary %name.', array('%name' => $vocabulary->name), WATCHDOG_NOTICE, l(t('edit'), 'admin/structure/taxonomy/' . $vocabulary->machine_name . '/edit')); break; } @@ -824,11 +824,11 @@ function taxonomy_form_term_submit($form, &$form_state) { switch ($status) { case SAVED_NEW: drupal_set_message(t('Created new term %term.', array('%term' => $term->name))); - watchdog('taxonomy', 'Created new term %term.', array('%term' => $term->name), LOG_NOTICE, l(t('edit'), 'taxonomy/term/' . $term->tid . '/edit')); + watchdog('taxonomy', 'Created new term %term.', array('%term' => $term->name), WATCHDOG_NOTICE, l(t('edit'), 'taxonomy/term/' . $term->tid . '/edit')); break; case SAVED_UPDATED: drupal_set_message(t('Updated term %term.', array('%term' => $term->name))); - watchdog('taxonomy', 'Updated term %term.', array('%term' => $term->name), LOG_NOTICE, l(t('edit'), 'taxonomy/term/' . $term->tid . '/edit')); + watchdog('taxonomy', 'Updated term %term.', array('%term' => $term->name), WATCHDOG_NOTICE, l(t('edit'), 'taxonomy/term/' . $term->tid . '/edit')); // Clear the page and block caches to avoid stale data. cache_clear_all(); break; @@ -926,7 +926,7 @@ function taxonomy_term_confirm_delete_submit($form, &$form_state) { taxonomy_term_delete($form_state['values']['tid']); taxonomy_check_vocabulary_hierarchy($form['#vocabulary'], $form_state['values']); drupal_set_message(t('Deleted term %name.', array('%name' => $form_state['values']['name']))); - watchdog('taxonomy', 'Deleted term %name.', array('%name' => $form_state['values']['name']), LOG_NOTICE); + watchdog('taxonomy', 'Deleted term %name.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE); $form_state['redirect'] = 'admin/structure/taxonomy'; cache_clear_all(); return; @@ -966,7 +966,7 @@ function taxonomy_vocabulary_confirm_delete($form, &$form_state, $vid) { function taxonomy_vocabulary_confirm_delete_submit($form, &$form_state) { $status = taxonomy_vocabulary_delete($form_state['values']['vid']); drupal_set_message(t('Deleted vocabulary %name.', array('%name' => $form_state['values']['name']))); - watchdog('taxonomy', 'Deleted vocabulary %name.', array('%name' => $form_state['values']['name']), LOG_NOTICE); + watchdog('taxonomy', 'Deleted vocabulary %name.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE); $form_state['redirect'] = 'admin/structure/taxonomy'; cache_clear_all(); return; @@ -1006,6 +1006,6 @@ function taxonomy_vocabulary_confirm_reset_alphabetical_submit($form, &$form_sta ->condition('vid', $form_state['values']['vid']) ->execute(); drupal_set_message(t('Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']))); - watchdog('taxonomy', 'Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']), LOG_NOTICE); + watchdog('taxonomy', 'Reset vocabulary %name to alphabetical order.', array('%name' => $form_state['values']['name']), WATCHDOG_NOTICE); $form_state['redirect'] = 'admin/structure/taxonomy/' . $form_state['values']['machine_name']; } diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index afaddeb580a527927337cb3c15cf2980624f43af..0596bde4c1c387c8575a8810f6dd84a7778708ae 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -352,7 +352,7 @@ function user_admin_settings() { $picture_path = file_default_scheme() . '://' . variable_get('user_picture_path', 'pictures'); if (!file_prepare_directory($picture_path, FILE_CREATE_DIRECTORY)) { form_set_error('user_picture_path', t('The directory %directory does not exist or is not writable.', array('%directory' => $picture_path))); - watchdog('file system', 'The directory %directory does not exist or is not writable.', array('%directory' => $picture_path), LOG_ERR); + watchdog('file system', 'The directory %directory does not exist or is not writable.', array('%directory' => $picture_path), WATCHDOG_ERROR); } } $picture_support = variable_get('user_pictures', 0); diff --git a/modules/user/user.module b/modules/user/user.module index ffd170c458159285dd8256c0ebd0f6e083aa441f..4492c602880e745612dc29fbd9ee9e077c9de2bb 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -2303,7 +2303,7 @@ function user_cancel($edit, $uid, $method) { if (!$account) { drupal_set_message(t('The user account %id does not exist.', array('%id' => $uid)), 'error'); - watchdog('user', 'Attempted to cancel non-existing user account: %id.', array('%id' => $uid), LOG_ERR); + watchdog('user', 'Attempted to cancel non-existing user account: %id.', array('%id' => $uid), WATCHDOG_ERROR); return; } @@ -2354,7 +2354,7 @@ function _user_cancel($edit, $account, $method) { } user_save($account, array('status' => 0)); drupal_set_message(t('%name has been disabled.', array('%name' => $account->name))); - watchdog('user', 'Blocked user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), LOG_NOTICE); + watchdog('user', 'Blocked user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE); break; case 'user_cancel_reassign': @@ -2365,7 +2365,7 @@ function _user_cancel($edit, $account, $method) { } user_delete($account->uid); drupal_set_message(t('%name has been deleted.', array('%name' => $account->name))); - watchdog('user', 'Deleted user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), LOG_NOTICE); + watchdog('user', 'Deleted user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE); break; } @@ -3055,7 +3055,7 @@ function user_user_operations($form = array(), $form_state = array()) { ); } else { - watchdog('security', 'Detected malicious attempt to alter protected user fields.', array(), LOG_WARNING); + watchdog('security', 'Detected malicious attempt to alter protected user fields.', array(), WATCHDOG_WARNING); return; } } @@ -3713,7 +3713,7 @@ function user_register_submit($form, &$form_state) { $form_state['user'] = $account; $form_state['values']['uid'] = $account->uid; - watchdog('user', 'New user: %name (%email).', array('%name' => $form_state['values']['name'], '%email' => $form_state['values']['mail']), LOG_NOTICE, l(t('edit'), 'user/' . $account->uid . '/edit')); + watchdog('user', 'New user: %name (%email).', array('%name' => $form_state['values']['name'], '%email' => $form_state['values']['mail']), WATCHDOG_NOTICE, l(t('edit'), 'user/' . $account->uid . '/edit')); // Add plain text password into user account to generate mail tokens. $account->password = $pass; diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index 0d06ff27796bee072668383212dcf5e806921048..697a82d2c2c5cf132dcc6fa28d3ca11f8f1f9142 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -443,7 +443,7 @@ function user_cancel_confirm_form_submit($form, &$form_state) { $account = user_save($account, $edit); _user_mail_notify('cancel_confirm', $account); drupal_set_message(t('A confirmation request to cancel your account has been sent to your e-mail address.')); - watchdog('user', 'Sent account cancellation request to %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), LOG_NOTICE); + watchdog('user', 'Sent account cancellation request to %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE); $form_state['redirect'] = "user/$account->uid"; } diff --git a/update.php b/update.php index a777920fa071bf5d1c9d7e6174607722e6a943e4..105bc9d498b32a08b59cacebbbc2c7933d06a889 100644 --- a/update.php +++ b/update.php @@ -252,7 +252,7 @@ function update_info_page() { function update_access_denied_page() { drupal_add_http_header('Status', '403 Forbidden'); - watchdog('access denied', 'update.php', NULL, LOG_WARNING); + watchdog('access denied', 'update.php', NULL, WATCHDOG_WARNING); drupal_set_title('Access denied'); return '

Access denied. You are not authorized to access this page. Log in using either an account with the administer software updates permission or the site maintenance account (the account you created during installation). If you cannot log in, you will have to edit settings.php to bypass this access check. To do this:

    -- 1.7.4.1