From 4f0fd58c900d7f26381bbcc61fbfaf6c6d345336 Mon Sep 17 00:00:00 2001 From: Paul Richards Date: Sun, 17 May 2009 21:45:21 +0100 Subject: [PATCH] Add support for logging to Firebug ( http://www.firephp.org/ ) as logging method. --- core/logging_api.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/logging_api.php b/core/logging_api.php index 2dc4a5dad3..be5b962034 100644 --- a/core/logging_api.php +++ b/core/logging_api.php @@ -66,6 +66,21 @@ function log_event( $p_level, $p_msg ) { case 'file': error_log( $t_php_event . PHP_EOL, 3, $t_modifiers ); break; + case 'firebug': + if( !class_exists( 'FirePHP' ) ) { + if( file_exists( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'FirePHPCore' . DIRECTORY_SEPARATOR . 'FirePHP.class.php' ) ) { + require_once( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'FirePHPCore' . DIRECTORY_SEPARATOR . 'FirePHP.class.php' ); + } + } + if( class_exists( 'FirePHP' ) ) { + static $firephp; + if( $firephp === null ) { + $firephp = FirePHP::getInstance(true); + } + $firephp->log( $t_php_event ); + return; + } + // if firebug is not available, fall through default: # use default PHP error log settings error_log( $t_php_event . PHP_EOL );