Skip to content

Instantly share code, notes, and snippets.

@wsagen
Created October 31, 2014 05:26
Show Gist options
  • Save wsagen/44313046de40c17f47e8 to your computer and use it in GitHub Desktop.
Save wsagen/44313046de40c17f47e8 to your computer and use it in GitHub Desktop.
Magento log stack trace
private function get_callstack() {
$dt = debug_backtrace();
$cs = array();
foreach ($dt as $t) {
$cs[] = $t['file'] . ' line ' . $t['line'] . ' calls ' . $t['function'] . "()" ;
}
return $cs;
}
public function toLog() {
Mage::log($this->get_callstack());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment