Skip to content

Instantly share code, notes, and snippets.

@erikreagan
Created June 18, 2011 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikreagan/1033117 to your computer and use it in GitHub Desktop.
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)
<?php>
function log_item($str)
{
if ($this->debugging !== TRUE)
{
return;
}
if ($this->depth > 0)
{
$str = str_repeat('&nbsp;', $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