https://github.com/bkdotcom/PHPDebugConsole
Support for all the javascript console methods:
assert, clear, count, error, group, groupCollapsed, groupEnd, info, log, table, trace, time, timeEnd, warn
plus a few more:
alert, groupSummary, groupUncollapse, timeGet
$debug = new \bdk\Debug(array(
'collect' => true,
'output' => true,
'outputAs' => 'script',
));
$debug->log('hello world');
$debug->info('all of the javascript console methods are supported');
\bdk\Debug::_log('can use static methods');
$debug->trace();
$list = array(
array('userId'=>1, 'name'=>'Bob', 'sex'=>'M', 'naughty'=>false),
array('userId'=>10, 'naughty'=>true, 'name'=>'Sally', 'extracol' => 'yes', 'sex'=>'F'),
array('userId'=>2, 'name'=>'Fred', 'sex'=>'M', 'naughty'=>false),
);
$debug->table('people', $list);
this will output the appropriate <script>
tag upon script shutdown
alternatively, you can output as html, chromeLogger, FirePHP, file, plaintext, websockets, etc
upcomming release includes a psr-3 (logger) implementation