本文整理汇总了PHP中ChromePhp::info方法的典型用法代码示例。如果您正苦于以下问题:PHP ChromePhp::info方法的具体用法?PHP ChromePhp::info怎么用?PHP ChromePhp::info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChromePhp
的用法示例。
在下文中一共展示了ChromePhp::info方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: d
function d($arg)
{
$declared = 'variable';
ChromePhp::log('xdebug_get_declared_vars', xdebug_get_declared_vars());
ChromePhp::groupCollapsed('backtrace');
ChromePhp::log(debug_backtrace());
ChromePhp::groupEnd();
ChromePhp::info('Triggered notice.');
trigger_error('Custom notice', E_USER_NOTICE);
ChromePhp::warn('Triggered warning.');
trigger_error('Custom warning', E_USER_WARNING);
ChromePhp::error('Triggered error.');
trigger_error('Custom error', E_USER_ERROR);
}
示例2: _write
/**
* Write the data
*
* @param array $event Event Data
*/
public function _write($event)
{
$event = Mage::helper('firegento_logger')->getEventObjectFromArray($event);
$priority = $event->getPriority();
$message = $this->_formatter->format($event);
if ($priority !== false) {
switch ($priority) {
case Zend_Log::EMERG:
case Zend_Log::ALERT:
case Zend_Log::CRIT:
case Zend_Log::ERR:
ChromePhp::error($message);
break;
case Zend_Log::WARN:
ChromePhp::warn($message);
break;
case Zend_Log::NOTICE:
case Zend_Log::INFO:
case Zend_Log::DEBUG:
ChromePhp::info($message);
break;
default:
Mage::log('Unknown loglevel at ' . __CLASS__);
break;
}
} else {
Mage::log('Attached message event has no priority - skipping !');
}
}
示例3: handle
/**
* Using ChromePhp, log the message
*/
public function handle(PteLogMessage $message)
{
switch ($message->getType()) {
case PteLogMessage::$ERROR:
ChromePhp::error($message->getMessage());
break;
case PteLogMessage::$WARN:
ChromePhp::warn($message->getMessage());
break;
case PteLogMessage::$INFO:
ChromePhp::info($message->getMessage());
break;
case PteLogMessage::$DEBUG:
default:
ChromePhp::log($message->getMessage());
break;
}
}
示例4: init
public static function init()
{
return function ($info) {
switch ($info['level']) {
case \Analog\Analog::DEBUG:
\ChromePhp::log($info['message']);
break;
case \Analog\Analog::INFO:
case \Analog\Analog::NOTICE:
\ChromePhp::info($info['message']);
break;
case \Analog\Analog::WARNING:
\ChromePhp::warn($info['message']);
break;
case \Analog\Analog::ERROR:
case \Analog\Analog::CRITICAL:
case \Analog\Analog::ALERT:
case \Analog\Analog::URGENT:
\ChromePhp::error($info['message']);
break;
}
};
}
示例5: json_decode
$oUserInfo = json_decode($oRes);
ChromePhp::info($oUserInfo);
ChromePhp::info("GetUserInfo success");
if (isset($oCreds->Users)) {
foreach ($oCreds->Users as $sEmail) {
if ($sEmail == $oUserInfo->email) {
$_SESSION['loggedin'] = True;
ChromePhp::info("Login success");
break;
}
}
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == True) {
foreach ($oCreds->Admins as $sEmail) {
if ($sEmail == $oUserInfo->email) {
$_SESSION['isAdmin'] = True;
ChromePhp::info("Admin Login success");
break;
}
}
} else {
$oApp->render('error.phtml');
}
}
$oApp->redirect('/');
});
/***
* Inner functions
***/
function getUserType()
{
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == True) {
示例6: _logChrome
/**
* Log to chrome console
* @param $data, array, the data to be logged.
* @param $target, the target module name, "data" as default
* @param $type, string log level.
* @author Vincent Hou
**/
private static function _logChrome($data, $target = "data", $type = "error")
{
$logContent = ['level' => $type, 'module' => $target, 'data' => $data];
switch ($type) {
case 'info':
\ChromePhp::info(json_encode($logContent));
break;
case 'warn':
\ChromePhp::warn($logContent);
break;
default:
\ChromePhp::error($logContent);
break;
}
}
示例7: outputBrowser
static function outputBrowser($type, $data)
{
// Browser Extensions
if (CONSOLE_FIREPHP) {
try {
//if (!in_array($type, array("log", "info", "warn", "error"))) { $type = "log"; }
//FirePHP::{$type}($data);
switch ($type) {
case "log":
FirePHP::log($data);
break;
case "info":
FirePHP::info($data);
break;
case "warn":
FirePHP::warn($data);
break;
case "error":
FirePHP::error($data);
break;
default:
FirePHP::log($data);
break;
}
} catch (Exception $e) {
}
}
if (CONSOLE_CHROMELOGGER) {
try {
//if (!in_array($type, array("log", "info", "warn", "error", "group", , "groupCollapsed", "groupEnd"))) { $type = "log"; }
//ChromePhp::{$type}($data);
switch ($type) {
case "log":
ChromePhp::log($data);
break;
case "info":
ChromePhp::info($data);
break;
case "warn":
ChromePhp::warn($data);
break;
case "error":
ChromePhp::error($data);
break;
case "group":
ChromePhp::group($data);
break;
case "groupCollapsed":
ChromePhp::groupCollapsed($data);
break;
case "groupEnd":
ChromePhp::groupEnd($data);
break;
default:
ChromePhp::log($data);
break;
}
} catch (Exception $e) {
}
}
}
示例8: afterFilter
public function afterFilter()
{
parent::afterFilter();
// sql logging to chrome console
if (class_exists('ConnectionManager') && Configure::read('debug') >= 2) {
App::import('Vendor', 'ChromePhp/ChromePhp');
$sources = ConnectionManager::sourceList();
$logs = array();
foreach ($sources as $source) {
$db = ConnectionManager::getDataSource($source);
$logs[$source] = $db->getLog();
}
foreach ($logs as $source => $logInfo) {
$text = $logInfo['count'] > 1 ? 'queries' : 'query';
ChromePhp::info('------- SQL: ' . sprintf('(%s) %s %s took %s ms', $source, count($logInfo['log']), $text, $logInfo['time']) . ' -------');
ChromePhp::info('------- REQUEST: ' . $this->request->params['controller'] . '/' . $this->request->params['action'] . ' -------');
foreach ($logInfo['log'] as $k => $i) {
$i += array('error' => '');
if (!empty($i['params']) && is_array($i['params'])) {
$bindParam = $bindType = null;
if (preg_match('/.+ :.+/', $i['query'])) {
$bindType = true;
}
foreach ($i['params'] as $bindKey => $bindVal) {
if ($bindType === true) {
$bindParam .= h($bindKey) . " => " . h($bindVal) . ", ";
} else {
$bindParam .= h($bindVal) . ", ";
}
}
$i['query'] .= " , params[ " . rtrim($bindParam, ', ') . " ]";
}
$error = !empty($i['error']) ? "\nError: " . $i['error'] : "\n";
$logStr = $i['query'] . $error . "\nAffected: " . $i['affected'] . "\nNum. Rows: " . $i['numRows'] . "\nTook(ms): " . $i['took'] . "\n\n";
if (!empty($i['error'])) {
ChromePhp::error($logStr);
} else {
if ($i['took'] >= 100) {
ChromePhp::warn($logStr);
} else {
ChromePhp::info($logStr);
}
}
}
}
}
}