| » Metadata | » Status |
|---|---|
|
|
| » Description | |
|
Important: This proposal is not supposed to be a new package but a driver for existing PEAR::Log package Introduction What is FirePHP ? If you don't know it, FirePHP enables you to log to your Firebug Console using a simple PHP method call. You can know much more on visit official web site at http://www.firephp.org. Don't forget to visit also the FirePHP headquarters at http://www.firephp.org/HQ to see other frameworks integration (such Zend, Symfony, ...) What makes FirePHP different from other debugging methods ? All data is sent via a set of X-FirePHP-Data response headers. This means that the debugging data will not interfere with the content on your page. Avoid echo, var_dump, print_r, that you could use/add and forget to remove once your debugging step is over ! PEAR::Log integration Following FirePHP users coding style fb( mixed $Object ) fb( mixed $Object, 'Label' ) fb( mixed $Object, FirePHP::* ) fb( mixed $Object, 'Label', FirePHP::* ) and to match standard PEAR::Log function log($message, $priority = null) the $message parameter should be an array with 3 key-values: "message", "label" and "type".
There are some PHP constants ( PEAR_LOG_FIREPHP_* ) to match the FirePHP $Type behavior: For example: PEAR_LOG_FIREPHP_LOG stand for FirePHP::LOG, PEAR_LOG_FIREPHP_EXCEPTION stand for FirePHP::EXCEPTION, and so on ... So to code something equivalent to : You should write : TIP : when you use the convenience method, there is no need to give the "type" key-value. Each convenience method add it if missing. THANKS TO Michal Smolinski to suggest also the simple signature $logger->log($Object); // when $Object is a string SEE : firephp_composite.html (example script) source code line 20 Convenience functions logging (emerg, alert, crit, err, warning, notice, info, debug) are also supported (since 2008-11-01) . Configure options "timeFormat" and "lineFormat" are applied on "Label" if specified, then (if missing) it will be on "message" (only if object is a string) Examples script "firephp_basic.php" (highlighted and source code provided below) will produce such results: Examples script "firephp_composite.php" (highlighted and source code provided below) will produce such results: Quick Start
pear channel-discover pear.firephp.org pear install firephp/FirePHPCore Credits I gave my agreement to Christoph Dorn (author of FirePHP), to become a co-author to this proposal : Read the thread at http://n2.nabble.com/Dependency-too-high-on-PEAR-package-for-PHP-core-Library-td1319760ef842658.html Changelog 2008-10-11 : First draft version, only support FirePHP 0.1.2 features 2008-11-01 : Second draft version support FirePHP 0.2 features (options, error/exception/assert handlers, group messages) 2008-11-08 : New API following recommandation of Jon Parise 2008-11-11 : "object" key-value is replaced by "message" key-value to run better with other handlers especially with composite |
|
| » Dependencies | » Links |
|
|
| » Timeline | » Changelog |
|
|