You are here

function DrupalSalesforce::watchdog in Salesforce Suite 5.2

Same name and namespace in other branches
  1. 7 salesforce_api/salesforce.class.inc \DrupalSalesforce::watchdog()

Logs a message to the watchdog based on the Salesforce log settings.

Parameters

$level:

$message:

$severity:

$link:

1 call to DrupalSalesforce::watchdog()
DrupalSalesforce::login in salesforce_api/salesforce.class.inc
Establishes a connection and logs in to the Salesforce server.

File

salesforce_api/salesforce.class.inc, line 91
Defines the class used for communicating with the Salesforce server.

Class

DrupalSalesforce
Defines the DrupalSalesforce class used to interact with the server.

Code

function watchdog($level, $message, $severity = WATCHDOG_NOTICE, $link = NULL) {

  // Log nothing for notices if the related log level is not greater than or
  // equal to the level of this message.
  switch ($severity) {
    case WATCHDOG_NOTICE:
      if (variable_get('salesforce_api_activity_log', SALESFORCE_LOG_SOME) < $level) {
        return;
      }
      break;
    case WATCHDOG_WARNING:
    case WATCHDOG_ERROR:
      if (variable_get('salesforce_api_error_log', SALESFORCE_LOG_ALL) < $level) {
        return;
      }
      break;
    default:
      break;
  }

  // Log the message to the watchdog.
  watchdog('salesforce', $message, $severity, $link);
}