You are here

function messaging_log_format in Messaging 7

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

Format logs

File

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

Code

function messaging_log_format($logs) {
  $rows = array();
  foreach ($logs as $log) {
    list($type, $string, $append, $objects) = _messaging_log_format($log);

    // Full objects/arrays are only rendered when debug module is enabled
    if ($objects && function_exists('_messaging_debug_format_log')) {
      $text = _messaging_debug_format_log($type, $string, $append, $objects);
    }
    else {
      $text = $string;
      if ($append) {
        $text .= '<br />' . implode(' ', $append);
      }
    }
    $rows[] = array(
      $type,
      $text,
    );
  }
  $header = array(
    t('Type'),
    t('Message'),
  );
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}