You are here

function _messaging_log in Messaging 7

Same name and namespace in other branches
  1. 6.4 messaging.module \_messaging_log()
  2. 6 messaging.module \_messaging_log()
  3. 6.2 messaging.module \_messaging_log()
  4. 6.3 messaging.module \_messaging_log()

Quick logging for debugging and manual queue processing

3 calls to _messaging_log()
messaging_devel_log in messaging_devel/messaging_devel.module
Messaging debug logs
messaging_log_get in messaging_devel/messaging_devel.module
Get logs without formatting
messaging_log_start in messaging_devel/messaging_devel.module
Init logging system so logs are saved from now on

File

messaging_devel/messaging_devel.module, line 378
Simple messaging using html page. Messaging method plug-in

Code

function _messaging_log($type, $txt = NULL, $variables = NULL, $severity = WATCHDOG_NOTICE) {
  static $enabled = FALSE;
  switch ($type) {
    case 'info':
    case 'debug':
      if ($enabled) {
        $_SESSION['messaging_log'][] = array(
          $type,
          $txt,
          $variables,
          $severity,
        );
      }
      break;
    case 'return':
      return isset($_SESSION['messaging_log']) ? $_SESSION['messaging_log'] : NULL;
      break;
    case 'reset':
      unset($_SESSION['messaging_log']);
      break;
    case 'start':
      $enabled = TRUE;
      break;
    case 'stop':
      $enabled = FALSE;
      break;
  }
}