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


PHP Object::log方法代码示例

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


在下文中一共展示了Object::log方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: log

 /**
  *
  * Log messages (debugging purpose)
  * @param string $msg
  * @param int $type (default 2)
  * @return <boolean/string>
  */
 public function log($msg, $type = 2)
 {
     if (class_exists('Object')) {
         !$this->_Object instanceof Object && ($this->_Object = new Object());
         return $this->_Object->log($msg, $type);
     }
     return false;
 }
开发者ID:astroChasqui,项目名称:open-websoccer,代码行数:15,代码来源:xmlToArray.php

示例2: process

 public static function process($exception)
 {
     if (class_exists('TransactionManager')) {
         TransactionManager::rollback();
     }
     $params = array('class' => $class = get_class($exception), 'message' => $exception->getMessage(), 'file' => str_replace(ROOT, 'ROOT', $exception->getFile()), 'line' => $exception->getLine(), 'trace' => $exception->getTraceAsString());
     $textError = self::_text($params);
     if (Configure::read('debug') == 0) {
         Object::log($textError);
         switch (true) {
             case $class === 'DatabaseError':
                 return Object::cakeError('error503', array(array('code' => 503, 'name' => 'Service Unavailable', 'message' => '')));
             case isset($exception->httpCode):
                 $error = $exception->httpCode === 403 ? 'forbidden' : 'error' . $exception->httpCode;
                 return Object::cakeError($error);
         }
         return Object::cakeError('error500', array(array('code' => 500, 'name' => 'An Internal Error Has Occurred', 'message' => '')));
     } else {
         if (php_sapi_name() == 'cli') {
             echo $textError;
         } else {
             header('Content-Type: text/html; charset=UTF-8');
             echo self::_html($params);
         }
     }
 }
开发者ID:hiromi2424,项目名称:ninja,代码行数:26,代码来源:exception_handler.php

示例3: logIt

 /**
  * This method writes messages in a log file.
  * @param String $msg A message to write.
  * @return Worker
  */
 public function logIt($msg)
 {
     if (!is_null($this->logger)) {
         $this->logger->log(LogLevel::INFO, $msg);
     }
     return $this;
 }
开发者ID:bsmrs,项目名称:bughunter,代码行数:12,代码来源:Worker.php

示例4: _dispatchService

 protected function _dispatchService($callback, $params, $options = array())
 {
     $options += array('catchTry' => $this->catchTry, 'logException' => $this->logException);
     $this->begin();
     if ($options['catchTry']) {
         try {
             $result = call_user_func_array($callback, $params);
         } catch (Exception $e) {
             if ($options['logException']) {
                 Object::log($e->__toString());
             }
             $result = false;
         }
     } else {
         $result = call_user_func_array($callback, $params);
     }
     if (!$result) {
         $this->rollback();
     } else {
         $this->commit();
     }
     return $result;
 }
开发者ID:hiromi2424,项目名称:ninja,代码行数:23,代码来源:transaction_service.php

示例5: direct

 /**
  * This method is called automatically when using the name of the helper directly
  *
  * @param string $message 
  * @param string $debugLevel 
  * @return void
  */
 public function direct($message, $debugLevel = Zend_Log::INFO)
 {
     $this->logger->log($message, $debugLevel);
 }
开发者ID:omusico,项目名称:logica,代码行数:11,代码来源:Logger.php

示例6: log

 function log($msg, $type = LOG_ERROR)
 {
     if (!empty($this->config['nick'])) {
         $type = $this->config['nick'];
     } else {
         $type = 'error';
     }
     parent::log($msg, $type);
 }
开发者ID:jayadianto,项目名称:hermes,代码行数:9,代码来源:YahooMessenger.php

示例7: log

 /**
  * log method
  *
  * Record to the log (the head doc block on first load in debug mode) or output the log (call with no params)
  *
  * @param mixed $string
  * @static
  * @return logs contents if requested, otherwise null
  * @access public
  */
 public static function log($string = null, $shellObject = null)
 {
     if (self::$start === null) {
         self::$start = microtime(true);
     }
     static $log = array();
     if ($shellObject) {
         self::$__Shell =& $shellObject;
     }
     if ($string === null) {
         $settings = self::$settings;
         ksort($settings);
         foreach ($settings as $k => &$v) {
             $v = ' ' . str_pad($k, 15, ' ', STR_PAD_RIGHT) . "\t: " . $v;
         }
         $settings[] = '';
         $head = array_merge(array('MiCompressor log - (only generated on first load) ' . date("D, M jS Y, H:i:s"), null), $settings);
         $log = array_merge($head, $log);
         $return = "/**\r\n * " . implode("\r\n * ", $log) . "\r\n */\r\n";
         $log = array();
         self::$start = microtime(true);
         return $return;
     }
     if (strpos($string, 'PROBLEM') !== false && class_exists('Object')) {
         $Object = new Object();
         $Object->log($string, 'mi_compressor');
     }
     $time = microtime(true) - self::$start;
     $msg = str_pad(number_format($time, 3, '.', ''), 6, ' ', STR_PAD_LEFT) . 's ' . $string;
     if (!empty(self::$__Shell)) {
         self::$__Shell->out($msg);
     }
     $log[] = $msg;
 }
开发者ID:razzman,项目名称:mi_asset,代码行数:44,代码来源:MiCompressor.php


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