/** * class constructor will include the external console class, initialize it and store * its instance as $console property. the class can not be instantiated other * then using singleton method create. the loaded console class will be init and map * with its log types to this classed log types. * * @error 10901 * @param string $driver expects the driver string to load * @param array $options expects an driver dependent option array * @throws Xapp_Error */ protected function __construct($driver, array $options = array()) { $this->_driver = strtolower(trim($driver)); switch ($this->_driver) { case 'firephp': xapp_import('firephp.firephp-core.*'); if (sizeof(ob_list_handlers()) === 0) { ob_start(); } $this->console = FirePHP::init(); $this->console->setOptions($options); self::$_typeMap = array_merge(self::$_typeMap, array('log' => FirePHP::LOG, 'warn' => FirePHP::WARN, 'info' => FirePHP::INFO, 'error' => FirePHP::ERROR, 'dump' => FirePHP::DUMP, 'trace' => FirePHP::TRACE, 'group' => FirePHP::GROUP_START, 'ungroup' => FirePHP::GROUP_END)); break; case 'chromephp': xapp_import('xapp.Ext.ChromePhp'); $this->console = ChromePhp::getInstance(); if (!isset($options[ChromePhp::BACKTRACE_LEVEL])) { $options[ChromePhp::BACKTRACE_LEVEL] = 2; } $this->console->addSettings($options); self::$_typeMap = array_merge(self::$_typeMap, array('log' => ChromePhp::LOG, 'warn' => ChromePhp::WARN, 'info' => ChromePhp::INFO, 'error' => ChromePhp::ERROR, 'dump' => ChromePhp::INFO, 'trace' => ChromePhp::INFO, 'group' => ChromePhp::GROUP, 'ungroup' => ChromePhp::GROUP_END)); break; default: throw new Xapp_Error(xapp_sprintf(_("xapp console driver: %s not supported"), $driver), 1090101); } }
public function __construct() { if (!class_exists('ChromePhp')) { require_once PTE_PLUGINPATH . 'php/chromephp/ChromePhp.php'; } ChromePhp::getInstance()->addSetting(ChromePhp::BACKTRACE_LEVEL, 5); }
public static function init() { global $config; Logger::$test = $config["test"]; ChromePhp::getInstance()->addSetting(ChromePhp::BACKTRACE_LEVEL, 2); }
<?php require_once PTE_PLUGINPATH . 'php/chromephp/ChromePhp.php'; ChromePhp::getInstance()->addSetting(ChromePhp::BACKTRACE_LEVEL, 5); class PteLogMessage { public static $ERROR = 1; public static $WARN = 2; public static $INFO = 4; public static $DEBUG = 8; protected $message; protected $type; protected $date; private function getTypeString() { switch ($this->type) { case self::$ERROR: return __("ERROR", PTE_DOMAIN); break; case self::$WARN: return __("WARNING", PTE_DOMAIN); break; case self::$INFO: return __("INFO", PTE_DOMAIN); break; default: return __("DEBUG", PTE_DOMAIN); } } public function __construct($type, $message) {
public function __construct() { include 'api/chromephp/ChromePhp.php'; $this->api = ChromePhp::getInstance(); }
protected function _getInstance() { return \ChromePhp::getInstance(); }
public static function init() { ChromePhp::getInstance()->addSetting(ChromePhp::BACKTRACE_LEVEL, 2); }