define('FIREPHP_WARN', false); define('FIREPHP_ERROR', false); define('FIREPHP_TRACE', true); require_once '../../Grace/FirePHPCore/fb.php'; FB::log('Hello World !'); // 常规记录 \FB::group('Test Group A', ['Collapsed' => true]); // 记录分组 // 以下为按照不同类别或者类型进行信息记录 FB::log('Plain Message'); FB::info('Info Message'); FB::warn('Warn Message'); FB::error('Error Message'); FB::log('Message', 'Optional Label'); FB::info([1, 2, 3, 5, 56], "All Turtles"); FB::groupEnd(); FB::group('Test Group B'); FB::log('Hello World B'); FB::log('Plain Message'); FB::info('Info Message'); FB::warn('Warn Message'); FB::error('Error Message'); FB::log('Message', 'Optional Label'); FB::groupEnd(); $table[] = array('Col 1 Heading', 'Col 2 Heading', 'Col 2 Heading'); $table[] = array('Row 1 Col 1', 'Row 1 Col 2', 'Row 1 Col 2'); $table[] = array('Row 2 Col 1', 'Row 2 Col 2'); $table[] = array('Row 3 Col 1', 'Row 3 Col 2'); FB::table('Table Label', $table); FB::trace('123', [1, 23, 4]);
/** * display debug_backtrace() * (display in firefox console if Firephp is enabled) * * @param mixed $obj * @return void */ public static function trace($obj = NULL, $label = '') { if (PS_USE_FIREPHP) { FB::trace($obj, $label); } else { Tools::p($obj); echo '<pre><h1>' . $label . '</h1><br/>'; debug_print_backtrace(); echo '</pre>'; } }
/** * Sends backtrace using using FirePHP. * * @param mixed $var */ function fb_trace() { FB::trace('Backtrace'); }
<?php FB::group('Test Group'); FB::send('Hello World'); FB::groupEnd(); FB::log('Log Message'); FB::info('Info Message'); FB::warn('Info Message'); FB::error('Info Message'); FB::trace('Trace to here'); FB::send('Trace to here', FirePHP::TRACE); FB::table('2 SQL queries took 0.06 seconds', array(array('SQL Statement', 'Time', 'Result'), array('SELECT * FROM Foo', '0.02', array('row1', 'row2')), array('SELECT * FROM Bar', '0.04', array('row1', 'row2')))); FB::dump('PHP Version', phpversion());