Drupal 7 print stack trace

Drupal 7 stack track

 

//$e = new \Exception;
//$trace = var_dump($e->getTraceAsString());
//$trace = $e->getTraceAsString();
//$formatted_trace = str_replace('#', '<br />#',$trace);
//drupal_set_message($formatted_trace);
//drupal_debug($e->getTrace());
//debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);