You are here

function mailhandler_watchdog_record in Mailhandler 6

Log a Mailhandler message.

This is a wrapper call to watchdog, to avoid selective events recording from the Mailhandler configuration. For debug messages, the caller function and line is shown in the 'Operations' column.

Parameters

$message: The message to store in the log. See t() for documentation on how $message and $variables interact. Keep $message translatable by not concatenating dynamic values into it!

$variables: Array of variables to replace in the message on display or NULL if message is already translated or not possible to translate.

$severity: The severity of the message, as per RFC 3164. Possible values are WATCHDOG_ERROR, WATCHDOG_WARNING, etc.

$link: A link to associate with the message.

See also

watchdog_severity_levels()

watchdog()

Related topics

17 calls to mailhandler_watchdog_record()
mailhandler_comment_submit in ./mailhandler.module
Create the comment.
mailhandler_get_parts in ./mailhandler.retrieve.inc
Returns an array of parts as file objects
mailhandler_mailbox_delete in ./mailhandler.module
Delete a Mailhandler Mailbox from the database.
mailhandler_mailbox_load in ./mailhandler.module
Load a mailbox array from database.
mailhandler_mailbox_load_multiple in ./mailhandler.module
Load mailboxes from the database.

... See full list

File

./mailhandler.module, line 1351
Mailhandler module code.

Code

function mailhandler_watchdog_record($message, $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL) {
  if ($severity <= variable_get('mailhandler_watchdog_level', WATCHDOG_INFO)) {

    // Use 'Operations' column to show function and line of the message call.
    // @todo: build a link to an updated contrib API site.
    if (!$link) {
      $caller = _mailhandler_get_last_caller(debug_backtrace());
      $link = $caller['line'] . ' : ' . $caller['function'];
    }
    watchdog('mailhandler', $message, $variables, $severity, $link);
  }
}