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


PHP Logger::critical方法代码示例

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


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

示例1: send

 /**
  * Sends message
  * @param  integer $type
  * @param  string  $msg
  * @return void
  */
 public function send($type, $msg)
 {
     $err = 0;
     if (!msg_send($this->queue, $type, $msg, true, false, $err)) {
         $this->logger->critical("Message of type {$type} not sent: {$err}", (array) $msg);
     } else {
         $this->logger->debug("Message of type {$type} sent", (array) $msg);
     }
 }
开发者ID:shitfSign,项目名称:threads,代码行数:15,代码来源:Queue.php

示例2: __construct

 public function __construct(Config $config, Logger $logger)
 {
     $this->config = $config;
     $this->logger = $logger;
     if (($this->config->usecache || $this->config->storecache) && !is_dir($this->config->cachedir)) {
         $this->logger->critical("[Cache] Configured cache directory [{$this->config->cachedir}] does not exist!");
         throw new Exception("[Cache] Configured cache directory [{$this->config->cachedir}] does not exist!");
     }
     if ($this->config->storecache && !is_writable($this->config->cachedir)) {
         $this->logger->critical("[Cache] Configured cache directory [{$this->config->cachedir}] lacks write permission!");
         throw new Exception("[Cache] Configured cache directory [{$this->config->cachedir}] lacks write permission!");
     }
 }
开发者ID:riverstore,项目名称:imdbphp,代码行数:13,代码来源:Cache.php

示例3: testCriticalLevel

 public function testCriticalLevel()
 {
     $this->expectOutputString('critical: Message contents');
     $echo = new Adaptors\EchoAdaptor('debug', '{level}: {message}');
     $logger = new Logger($echo);
     $logger->critical('Message contents');
 }
开发者ID:onesimus-systems,项目名称:oslogger,代码行数:7,代码来源:LoggerTest.php

示例4: __construct

 public function __construct()
 {
     $this->prefs = Preferences::getInstance();
     if (!$this->prefs) {
         Logger::critical('main', 'SessionManagement::__construct - get Preferences failed');
         throw_response(INTERNAL_ERROR);
     }
 }
开发者ID:skdong,项目名称:nfs-ovd,代码行数:8,代码来源:SessionManagement.php

示例5: getUser

 public function getUser()
 {
     try {
         $user = Zend_Registry::get("pimcore_user");
         if (!$user instanceof User) {
             Logger::critical("Webservice instantiated, but no user present");
         }
         return $user;
     } catch (Exception $e) {
         Logger::error($e);
         throw $e;
     }
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:13,代码来源:Service.php

示例6: getPhpCli

 /**
  * @return mixed
  * @throws \Exception
  */
 public static function getPhpCli()
 {
     if (Config::getSystemConfig()->general->php_cli) {
         if (@is_executable(Config::getSystemConfig()->general->php_cli)) {
             return (string) Config::getSystemConfig()->general->php_cli;
         } else {
             \Logger::critical("PHP-CLI binary: " . Config::getSystemConfig()->general->php_cli . " is not executable");
         }
     }
     $paths = array("/usr/bin/php", "/usr/local/bin/php", "/usr/local/zend/bin/php", "/bin/php", realpath(PIMCORE_DOCUMENT_ROOT . "/../php/php.exe"));
     foreach ($paths as $path) {
         if (@is_executable($path)) {
             return $path;
         }
     }
     throw new \Exception("No php executable found, please configure the correct path in the system settings");
 }
开发者ID:yonetici,项目名称:pimcore-coreshop-demo,代码行数:21,代码来源:Console.php

示例7: getPhpCli

 /**
  * @static
  * @return string
  */
 public static function getPhpCli()
 {
     if (Pimcore_Config::getSystemConfig()->general->php_cli) {
         if (is_executable(Pimcore_Config::getSystemConfig()->general->php_cli)) {
             return (string) Pimcore_Config::getSystemConfig()->general->php_cli;
         } else {
             Logger::critical("PHP-CLI binary: " . Pimcore_Config::getSystemConfig()->general->php_cli . " is not executable");
         }
     }
     $paths = array("/usr/bin/php", "/usr/local/bin/php", "/usr/local/zend/bin/php", "/bin/php");
     foreach ($paths as $path) {
         if (is_executable($path)) {
             return $path;
         }
     }
     throw new Exception("No php executable found, please configure the correct path in the system settings");
 }
开发者ID:shanky0110,项目名称:pimcore-custom,代码行数:21,代码来源:Console.php

示例8: getFfmpegCli

 /**
  * @static
  * @return string
  */
 public static function getFfmpegCli()
 {
     if (Pimcore_Config::getSystemConfig()->assets->ffmpeg) {
         if (is_executable(Pimcore_Config::getSystemConfig()->assets->ffmpeg)) {
             return Pimcore_Config::getSystemConfig()->assets->ffmpeg;
         } else {
             Logger::critical("FFMPEG binary: " . Pimcore_Config::getSystemConfig()->assets->ffmpeg . " is not executable");
         }
     }
     $paths = array("/usr/bin/ffmpeg", "/usr/local/bin/ffmpeg", "/bin/ffmpeg");
     foreach ($paths as $path) {
         if (is_executable($path)) {
             return $path;
         }
     }
     throw new Exception("No ffmpeg executable found, please configure the correct path in the system settings");
 }
开发者ID:nblackman,项目名称:pimcore,代码行数:21,代码来源:Ffmpeg.php

示例9: getWkhtmltoimageBinary

 /**
  * @return bool
  */
 public static function getWkhtmltoimageBinary()
 {
     if (Config::getSystemConfig()->documents->wkhtmltoimage) {
         if (@is_executable(Config::getSystemConfig()->documents->wkhtmltoimage)) {
             return (string) Config::getSystemConfig()->documents->wkhtmltoimage;
         } else {
             \Logger::critical("wkhtmltoimage binary: " . Config::getSystemConfig()->documents->wkhtmltoimage . " is not executable");
         }
     }
     $paths = array("/usr/bin/wkhtmltoimage-amd64", "/usr/local/bin/wkhtmltoimage-amd64", "/bin/wkhtmltoimage-amd64", "/usr/bin/wkhtmltoimage", "/usr/local/bin/wkhtmltoimage", "/bin/wkhtmltoimage", realpath(PIMCORE_DOCUMENT_ROOT . "/../wkhtmltox/wkhtmltoimage.exe"));
     foreach ($paths as $path) {
         if (@is_executable($path)) {
             return $path;
         }
     }
     return false;
 }
开发者ID:Gerhard13,项目名称:pimcore,代码行数:20,代码来源:HtmlToImage.php

示例10: getLibreOfficeCli

 /**
  * @return mixed
  * @throws \Exception
  */
 public static function getLibreOfficeCli()
 {
     $loPath = Config::getSystemConfig()->assets->libreoffice;
     if ($loPath) {
         if (@is_executable($loPath)) {
             return $loPath;
         } else {
             \Logger::critical("LibreOffice binary: " . $loPath . " is not executable");
         }
     }
     $paths = array("/usr/local/bin/soffice", "/usr/bin/soffice", "/bin/soffice");
     foreach ($paths as $path) {
         if (@is_executable($path)) {
             return $path;
         }
     }
     throw new \Exception("No LibreOffice executable found, please configure the correct path in the system settings");
 }
开发者ID:ChristophWurst,项目名称:pimcore,代码行数:22,代码来源:LibreOffice.php

示例11: test_methods_Magento

 public function test_methods_Magento()
 {
     $CONFIG_FILE_NAME = __DIR__ . '/logging_exception.yaml';
     $LOGGER_NAME = 'defaultLoggerName';
     /**
      * Perform testing.
      */
     $log = new Logger($CONFIG_FILE_NAME, $LOGGER_NAME);
     $context = ['test' => true, 'env' => ['param1' => 'value1']];
     $log->debug('debug', $context);
     $log->info('info', $context);
     $log->notice('notice', $context);
     $log->warning('warning', $context);
     $log->error('error', $context);
     $log->alert('alert', $context);
     $log->critical('critical', $context);
     $log->emergency('emergency', $context);
 }
开发者ID:praxigento,项目名称:mage_ext_logging,代码行数:18,代码来源:Logger_Test.php

示例12: getPdftotextCli

 /**
  * @return mixed
  * @throws \Exception
  */
 public static function getPdftotextCli()
 {
     // check the system-config for a path
     $configPath = Config::getSystemConfig()->assets->pdftotext;
     if ($configPath) {
         if (@is_executable($configPath)) {
             return $configPath;
         } else {
             \Logger::critical("Binary: " . $configPath . " is not executable");
         }
     }
     $paths = array("/usr/local/bin/pdftotext", "/usr/bin/pdftotext", "/bin/pdftotext");
     foreach ($paths as $path) {
         if (@is_executable($path)) {
             return $path;
         }
     }
     throw new \Exception("No pdftotext executable found, please configure the correct path in the system settings");
 }
开发者ID:emanuel-london,项目名称:pimcore,代码行数:23,代码来源:Ghostscript.php

示例13: usersGroups

 public function usersGroups()
 {
     Logger::debug('main', 'USER::UsersGroups');
     $result = array();
     // add the default user group is enable
     $prefs = Preferences::getInstance();
     if (!$prefs) {
         Logger::critical('main', 'USER::UsersGroups get prefs failed');
         die_error('get Preferences failed', __FILE__, __LINE__);
     }
     $user_default_group = $prefs->get('general', 'user_default_group');
     $userGroupDB = UserGroupDB::getInstance();
     $static = Abstract_Liaison::load('UsersGroup', $this->attributes['login'], NULL);
     if (is_null($static)) {
         Logger::error('main', 'User::usersGroups load(' . $this->attributes['login'] . ') is null');
         return $result;
     }
     if ($userGroupDB->isDynamic()) {
         $dynamic = Abstract_Liaison_dynamic::load('UsersGroup', $this->attributes['login'], NULL);
         if (is_null($dynamic)) {
             $dynamic = array();
         }
     } else {
         $dynamic = array();
     }
     $rows = array_unique(array_merge($static, $dynamic));
     if (!is_null($user_default_group) && $user_default_group !== '-1' && $user_default_group !== '') {
         $g = $userGroupDB->import($user_default_group);
         // safe because even if  group = -1, the import failed safely
         if (is_object($g)) {
             $result[$user_default_group] = $g;
         }
     }
     foreach ($rows as $lug) {
         $g = $userGroupDB->import($lug->group);
         if (is_object($g)) {
             $result[$lug->group] = $g;
         } else {
             Logger::error('main', 'USER::usersGroups user group (\'' . $lug->group . '\') not ok');
         }
     }
     return $result;
 }
开发者ID:skdong,项目名称:nfs-ovd,代码行数:43,代码来源:User.class.php

示例14: perform

 public function perform($error_ = false, $file_ = NULL, $line_ = NULL, $display_ = false)
 {
     $display_ = true;
     //always display the real error message instead of a generic one
     $file_ = substr(str_replace(SESSIONMANAGER_ROOT, '', $file_), 1);
     Logger::debug('main', 'die_error() called with message \'' . $error_ . '\' in ' . $file_ . ':' . $line_);
     Logger::critical('main', $error_);
     header('Content-Type: text/xml; charset=utf-8');
     $dom = new DomDocument('1.0', 'utf-8');
     $node = $dom->createElement('error');
     $node->setAttribute('id', 0);
     if ($display_ === true) {
         $node->setAttribute('message', $error_);
     } else {
         $node->setAttribute('message', 'The service is not available, please try again later');
     }
     $dom->appendChild($node);
     echo $dom->saveXML();
     die;
 }
开发者ID:bloveing,项目名称:openulteo,代码行数:20,代码来源:ErrorManager.class.php

示例15: __construct

 public function __construct($game)
 {
     if (!isset($_SERVER['HTTP_HOST'])) {
         throw new GambinoException(__CLASS__ . ' Unable to instantiate due to absence of HTTP_HOST in $_SERVER');
     }
     parent::__construct($game);
     try {
         $this->facebook = new \Facebook($this->getFacebookConfig());
         $this->session_cached = new \DateTime();
         $this->user_id = $this->facebook->getUser();
         $this->user_profile = $this->facebook->api('/me');
         $this->user_email = trim($this->user_profile['email']);
         $this->user_nicename = trim($this->user_profile['username']);
     } catch (\FacebookApiException $ex) {
         // This is not usually thrown when getting the userId from Facebook
         // but when you try to do something that requires some elevated
         // permissions
         // Facebook token has expired
         Logger::critical('Facebook OAuth (session) token invalid');
     }
 }
开发者ID:chrisnoden,项目名称:facebook-utils,代码行数:21,代码来源:UserAccessToken.php


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