You are here

function messaging_debug_log in Messaging 6.3

Same name and namespace in other branches
  1. 6.2 messaging_debug/messaging_debug.module \messaging_debug_log()

Messaging debug logs

Sometimes we are passing objects as variables, we need to make sure they are not by reference We can let this be for normal logs but for debugging we want accurate unique data on each stage

Another issue is that objects stored in session are serialized and then unserialized when session starts, that if classes are not there yet converts them to __PHP_Incomplete_Class Object

2 calls to messaging_debug_log()
messaging_debug in ./messaging.module
Short hand for debug logs
messaging_log in ./messaging.module
Short hand for info logs
2 string references to 'messaging_debug_log'
messaging_debug in ./messaging.module
Short hand for debug logs
messaging_log in ./messaging.module
Short hand for info logs

File

messaging_debug/messaging_debug.module, line 319
Simple messaging using html page. Messaging method plug-in

Code

function messaging_debug_log($txt = NULL, $variables = NULL, $type = 'debug') {

  // Sometimes we are passing objects as variables, we need to make sure they are not by reference
  // We can let this be for normal logs but for debugging we want accurate unique data on each stage
  $objects = NULL;
  if ($variables) {
    foreach ($variables as $key => $value) {
      if (is_object($value)) {
        $objects[$key] = $value;
        unset($variables[$key]);
      }
    }
    if (!empty($objects)) {
      $variables['debug_objects'] = array_map('serialize', $objects);
    }
  }
  return _messaging_log($type, $txt, $variables);
}