当前位置: 首页>>代码示例>>PHP>>正文


PHP ChromePhp::error方法代码示例

本文整理汇总了PHP中ChromePhp::error方法的典型用法代码示例。如果您正苦于以下问题:PHP ChromePhp::error方法的具体用法?PHP ChromePhp::error怎么用?PHP ChromePhp::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ChromePhp的用法示例。


在下文中一共展示了ChromePhp::error方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
开发者ID:aikeay,项目名称:sandbox,代码行数:14,代码来源:demo.php

示例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 !');
     }
 }
开发者ID:kirchbergerknorr,项目名称:firegento-logger,代码行数:34,代码来源:Chromelogger.php

示例3: message

 public function message($message, $level)
 {
     switch ($level) {
         case 'error':
             ChromePhp::error($message);
             break;
         case 'warning':
             ChromePhp::warning($message);
             break;
         case 'info':
         default:
             ChromePhp::log($message);
             break;
     }
 }
开发者ID:demental,项目名称:m,代码行数:15,代码来源:chromephp.php

示例4: chrome_log

 /**
  * Using ChromePhp, log the message
  */
 private function chrome_log($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;
     }
 }
开发者ID:roycocup,项目名称:enclothed,代码行数:21,代码来源:log.php

示例5: 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;
         }
     };
 }
开发者ID:Selwyn-b,项目名称:elefant,代码行数:23,代码来源:ChromeLogger.php

示例6: json_decode

     return;
 }
 $oCreds = json_decode(file_get_contents(__DIR__ . "/../creds/google.json"));
 define('CLIENT_ID', $oCreds->ClientID);
 define('CLIENT_SECRET', $oCreds->ClientSecret);
 define('CALLBACK_URL', (empty($_SERVER["HTTPS"]) ? "http://" : "https://") . $_SERVER["HTTP_HOST"] . "/login");
 define('TOKEN_URL', 'https://accounts.google.com/o/oauth2/token');
 define('INFO_URL', 'https://www.googleapis.com/oauth2/v1/userinfo');
 $params = array('code' => $_GET['code'], 'grant_type' => 'authorization_code', 'redirect_uri' => CALLBACK_URL, 'client_id' => CLIENT_ID, 'client_secret' => CLIENT_SECRET);
 $params = http_build_query($params, "", "&");
 $header = array("Content-Type: application/x-www-form-urlencoded", "Content-Length: " . strlen($params));
 $options = array('http' => array('method' => 'POST', 'header' => implode("\r\n", $header), 'content' => $params));
 $oRes = file_get_contents(TOKEN_URL, false, stream_context_create($options));
 $token = json_decode($oRes, true);
 if (isset($token['error'])) {
     ChromePhp::error('error');
     exit;
 }
 $access_token = $token['access_token'];
 $params = array('access_token' => $access_token);
 $oRes = file_get_contents(INFO_URL . '?' . http_build_query($params));
 $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;
         }
开发者ID:take-iwiw,项目名称:EcSiteDvdShop,代码行数:31,代码来源:index.php

示例7: error

 public static function error($id, $message)
 {
     if (!Logger::$test) {
         ChromePhp::error($id . ":" . $message);
     }
 }
开发者ID:jibladakpo,项目名称:helpdesk,代码行数:6,代码来源:Logger.php

示例8: export

 /**
  * 	Output log content
  *
  *	@param	array	$content	Content to log
  * 	@return	void
  */
 public function export($content)
 {
     global $conf;
     if (!empty($conf->global->MAIN_SYSLOG_DISABLE_CHROMEPHP)) {
         return;
     }
     // Global option to disable output of this handler
     //We check the configuration to avoid showing PHP warnings
     if (count($this->checkConfiguration())) {
         return false;
     }
     try {
         // Warning ChromePHP must be into PHP include path. It is not possible to use into require_once() a constant from
         // database or config file because we must be able to log data before database or config file read.
         $oldinclude = get_include_path();
         set_include_path(SYSLOG_CHROMEPHP_INCLUDEPATH);
         include_once 'ChromePhp.class.php';
         set_include_path($oldinclude);
         ob_start();
         // To be sure headers are not flushed until all page is completely processed
         if ($content['level'] == LOG_ERR) {
             ChromePhp::error($content['message']);
         } elseif ($content['level'] == LOG_WARNING) {
             ChromePhp::warn($content['message']);
         } elseif ($content['level'] == LOG_INFO) {
             ChromePhp::log($content['message']);
         } else {
             ChromePhp::log($content['message']);
         }
     } catch (Exception $e) {
         // Do not use dol_syslog here to avoid infinite loop
     }
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:39,代码来源:mod_syslog_chromephp.php

示例9: handleError

 public static function handleError($code, $description, $file = null, $line = null, $context = null)
 {
     ChromePhp::error('PHP Error Code ' . $code . ': ' . $description . ' ' . $file . ':' . $line);
 }
开发者ID:Demired,项目名称:CakeWX,代码行数:4,代码来源:AppError.php

示例10: _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;
     }
 }
开发者ID:timelessmemory,项目名称:uhkklp,代码行数:22,代码来源:LogUtil.php

示例11: 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) {
         }
     }
 }
开发者ID:baki250,项目名称:angular-io-app,代码行数:61,代码来源:class.console.php

示例12: error

 public static function error($id, $message)
 {
     ChromePhp::error($id . ":" . $message);
 }
开发者ID:nicolasBREYNAERT,项目名称:helpdesk,代码行数:4,代码来源:Logger.php

示例13: 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);
                     }
                 }
             }
         }
     }
 }
开发者ID:Demired,项目名称:CakeWX,代码行数:47,代码来源:AppController.php


注:本文中的ChromePhp::error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。