5 Description: Sends StatusNet log output to FirePHP
7 Author: Craig Andrews <candrews@integralblue.com>
8 Author URI: http://candrews.integralblue.com/
12 * StatusNet - the distributed open-source microblogging tool
13 * Copyright (C) 2009, StatusNet, Inc.
15 * This program is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Affero General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU Affero General Public License for more details.
25 * You should have received a copy of the GNU Affero General Public License
26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
30 * @package MinifyPlugin
31 * @maintainer Craig Andrews <candrews@integralblue.com>
34 if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); }
36 // We bundle the FirePHP library...
37 set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/extlib/FirePHP/lib');
39 class FirePHPPlugin extends Plugin
43 function onInitializePlugin()
45 //Output buffering has to be enabled so FirePHP can send the HTTP headers it needs
47 require_once('FirePHPCore/FirePHP.class.php');
48 $this->firephp = FirePHP::getInstance(true);
51 function onStartLog(&$priority, &$msg, &$filename)
53 static $firephp_priorities = array(FirePHP::ERROR, FirePHP::ERROR, FirePHP::ERROR, FirePHP::ERROR,
54 FirePHP::WARN, FirePHP::LOG, FirePHP::LOG, FirePHP::INFO);
55 $priority = $firephp_priorities[$priority];
56 $this->firephp->fb($msg, $priority);
59 function onPluginVersion(&$versions)
61 $versions[] = array('name' => 'FirePHP',
62 'version' => STATUSNET_VERSION,
63 'author' => 'Craig Andrews',
64 'homepage' => 'http://status.net/wiki/Plugin:FirePHP',
66 _m('The FirePHP plugin writes StatusNet\'s log output to FirePHP.'));