You are here

function emaillog_emaillog_debug_info_alter in Logging and alerts 8

Same name and namespace in other branches
  1. 6.2 emaillog/emaillog.module \emaillog_emaillog_debug_info_alter()
  2. 7.2 emaillog/emaillog.module \emaillog_emaillog_debug_info_alter()
  3. 2.0.x emaillog/emaillog.module \emaillog_emaillog_debug_info_alter()

Replaces backtrace argument values with their types.

File

emaillog/emaillog.module, line 177
Drupal Module: Email Logging and Alerts.

Code

function emaillog_emaillog_debug_info_alter(&$debug_info) {
  if (isset($debug_info['debug_backtrace()']) && is_array($debug_info['debug_backtrace()']) && \Drupal::config('emaillog.settings')
    ->get('emaillog_backtrace_replace_args')) {
    foreach ($debug_info['debug_backtrace()'] as $trace_key => $trace) {
      $args = [];
      if (isset($trace['args']) && is_array($trace['args'])) {
        foreach ($trace['args'] as $key => $value) {
          $args[$key] = sprintf('%s(%s)', gettype($value), _emaillog_get_variable_size($value));
        }
        $debug_info['debug_backtrace()'][$trace_key]['args'] = implode(', ', $args);
      }
    }
  }
}