Created
June 18, 2011 13:48
-
-
Save erikreagan/1033117 to your computer and use it in GitHub Desktop.
EE Template Debugger log_item function tweak (based on an article by Greg Aker)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php> | |
function log_item($str) | |
{ | |
if ($this->debugging !== TRUE) | |
{ | |
return; | |
} | |
if ($this->depth > 0) | |
{ | |
$str = str_repeat(' ', $this->depth * 5).$str; | |
} | |
$time = microtime(TRUE)-$this->start_microtime; | |
$mem = ''; | |
if (function_exists('memory_get_usage')) | |
{ | |
$mem = ' / '.number_format(round(memory_get_usage()/1024/1024, 2),2).'MB'; | |
} | |
$this->log[] = '('.number_format($time, 6).$mem.') '.$str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment