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


PHP LoggerInterface::emergency方法代码示例

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


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

示例1: log

 /**
  * {@inheritdoc}
  */
 public function log($message, $level)
 {
     $message .= ' ' . $this->request->getRequestUri();
     if ($this->logLevel >= $level) {
         switch ($level) {
             case self::EMERGENCY:
                 $this->logger->emergency($message);
                 break;
             case self::ALERT:
                 $this->logger->alert($message);
                 break;
             case self::CRITICAL:
                 $this->logger->critical($message);
                 break;
             case self::ERROR:
                 $this->logger->error($message);
                 break;
             case self::WARNING:
                 $this->logger->warning($message);
                 break;
             case self::NOTICE:
                 $this->logger->notice($message);
                 break;
             case self::INFO:
                 $this->logger->info($message);
                 break;
             default:
                 $this->logger->debug($message);
         }
     }
 }
开发者ID:dragonsword007008,项目名称:magento2,代码行数:34,代码来源:Logger.php

示例2: emergency

 /**
  * System is unusable.
  *
  * @param string $message
  * @param array $context
  * @return bool
  */
 public function emergency($message, array $context = array())
 {
     if (self::isSetLogger()) {
         return self::$logger->emergency($message, $context);
     }
     return false;
 }
开发者ID:chenwenzhang,项目名称:initially-rpc,代码行数:14,代码来源:LoggerProxy.php

示例3: emergency

 /**
  * {@inheritdoc}
  */
 public function emergency($message, array $context = array())
 {
     if (!$this->logger) {
         return;
     }
     return $this->logger->emergency($message, $context);
 }
开发者ID:gbprod,项目名称:elastica-bundle,代码行数:10,代码来源:ElasticaLogger.php

示例4: emergency

 /**
  * System is unusable.
  *
  * @param string $message
  * @param array $context
  * @return null
  */
 public function emergency($message, array $context = array())
 {
     if ($this->logger) {
         $context = $this->getLoggerContext($context);
         $this->logger->emergency($message, $context);
     }
 }
开发者ID:aurimasniekis,项目名称:epwt-traits,代码行数:14,代码来源:LoggerAwareTrait.php

示例5: shutdown

 /**
  * Uncatchable error handler
  */
 public function shutdown()
 {
     $error = error_get_last();
     if ($error !== NULL && $error["type"] !== E_CORE_WARNING && $error["type"] !== E_WARNING && $error["type"] !== E_USER_WARNING && $error["type"] !== E_NOTICE && $error["type"] !== E_USER_NOTICE) {
         if (null !== $this->logger) {
             $this->logger->emergency($error["message"] . ' in ' . $error["file"] . ' on line ' . $error["line"]);
         }
     }
 }
开发者ID:sinergi,项目名称:core,代码行数:12,代码来源:ErrorHandler.php

示例6: execute

 /**
  * @param ContextInterface $context
  *
  * @return void
  */
 public function execute(ContextInterface $context)
 {
     if ($context instanceof ProfileContext) {
         $this->doExecute($context);
     } else {
         $message = sprintf('Expected ProfileContext but got %s', get_class($context));
         $this->logger->emergency($message, array('context' => $context));
         throw new LightSamlContextException($context, $message);
     }
 }
开发者ID:lightsaml,项目名称:lightsaml,代码行数:15,代码来源:AbstractProfileAction.php

示例7: doLog

 /**
  * Logs a message.
  *
  * @param string $message Message
  * @param string $priority Message priority
  *
  * @return void
  */
 public function doLog($message, $priority)
 {
     if (!$this->logger) {
         $this->buffer[] = compact('message', 'priority');
         return;
     }
     switch ($priority) {
         case sfLogger::EMERG:
             $this->logger->emergency($message);
             break;
         case sfLogger::ALERT:
             $this->logger->alert($message);
             break;
         case sfLogger::CRIT:
             $this->logger->critical($message);
             break;
         case sfLogger::ERR:
             $this->logger->error($message);
             break;
         case sfLogger::WARNING:
             $this->logger->warning($message);
             break;
         case sfLogger::NOTICE:
             $this->logger->notice($message);
             break;
         case sfLogger::INFO:
             $this->logger->info($message);
             break;
         case sfLogger::DEBUG:
             $this->logger->debug($message);
             break;
     }
 }
开发者ID:Phennim,项目名称:symfony1,代码行数:41,代码来源:sfPsrLoggerAdapter.class.php

示例8: emergency

 /**
  * System is unusable.
  *
  * @param string $message
  * @param array $context
  * @return null
  */
 public function emergency($message, array $context = array())
 {
     if (empty($this->logger)) {
         return;
     }
     $this->logger->emergency($this->getDefaultMessage() . $message, $context);
 }
开发者ID:sphring,项目名称:sphring,代码行数:14,代码来源:LoggerSphring.php

示例9: emergency

 /**
  * @param mixed $message
  * @param array $context
  * @return self
  */
 public function emergency($message, array $context = []) : self
 {
     if (!$this->logger) {
         return $this;
     }
     $this->logger->emergency($message, $context);
     return $this;
 }
开发者ID:sgc-fireball,项目名称:libphp,代码行数:13,代码来源:Daemon.php

示例10: handleJobs

 /**
  *
  */
 private function handleJobs()
 {
     // Handle jobs
     $this->out('Handling Jobs.');
     try {
         $this->manager->start();
     } catch (\Exception $e) {
         $this->logger->emergency("Highly unexpected exception while running Manager->start(), investigation needed.", ['message' => $e->getMessage(), 'trace' => $e->getTraceAsString()]);
     }
 }
开发者ID:unifact,项目名称:connector,代码行数:13,代码来源:RunCommand.php

示例11: tick

 public function tick()
 {
     if (null === $this->pdo) {
         $this->logger->warning('Unable to ping sql server, service pdo is unavailable');
         return;
     }
     //if connection is persistent we don't need to ping
     if (true === $this->pdo->getAttribute(\PDO::ATTR_PERSISTENT)) {
         return;
     }
     try {
         $startTime = microtime(true);
         $this->pdo->query('SELECT 1');
         $endTime = microtime(true);
         $this->logger->notice(sprintf('Successfully ping sql server (~%s ms)', round(($endTime - $startTime) * 100000), 2));
     } catch (\PDOException $e) {
         $this->logger->emergency('Sql server is gone, and unable to reconnect');
         throw $e;
     }
 }
开发者ID:rsrodrig,项目名称:MeetMeSoftware,代码行数:20,代码来源:PdoPeriodicPing.php

示例12: __construct

 public function __construct(UrlBuilder $u, LoggerInterface $logger)
 {
     $pages = array();
     // Disable `HTML` extension of CssSelector.
     CssSelector::disableHtmlExtension();
     $client = new Client();
     $crawler = $client->request('GET', (string) $u);
     $status = $client->getResponse()->getStatus();
     if ($status > 399) {
         $logger->emergency('Status ' . $status . ' getting ' . (string) $u);
     }
     $sitemap_crawler = $crawler->filter('urlset > url > loc');
     foreach ($sitemap_crawler as $url_loc) {
         $url = $url_loc->nodeValue;
         $pages[$url] = $url;
     }
     parent::__construct($pages);
 }
开发者ID:paul-m,项目名称:sitemap_verify,代码行数:18,代码来源:SitemapCrawler.php

示例13: shipmentTrackingSave

 public function shipmentTrackingSave(\Praxigento\Odoo\Api\Data\SaleOrder\Shipment\Tracking $data)
 {
     $result = false;
     /* replicate all data in one transaction */
     $def = $this->_manTrans->begin();
     try {
         $orderIdMage = $data->getSaleOrderIdMage();
         $trackNumber = $data->getData('shipment/trackingInfo/trackingNumber');
         $shippingMethodCode = $data->getData('shipment/trackingInfo/shippingCode');
         $this->_shipmentLoader->setOrderId($orderIdMage);
         /** @var \Magento\Sales\Model\Order\Shipment $shipment */
         $shipment = $this->_shipmentLoader->load();
         if ($shipment) {
             $carrierCode = $this->_manBusCodes->getMagCodeForCarrier($shippingMethodCode);
             $title = $this->_manBusCodes->getTitleForCarrier($shippingMethodCode);
             $track = $this->_manObj->create(\Magento\Sales\Model\Order\Shipment\Track::class);
             $track->setNumber($trackNumber);
             $track->setCarrierCode($carrierCode);
             $track->setTitle($title);
             $shipment->addTrack($track);
             $shipment->register();
             $shipment->save();
             $order = $shipment->getOrder();
             $invoice = $this->_manInvoice->prepareInvoice($order);
             $invoice->register();
             $invoice->save();
             $order->save();
             $this->_manTrans->commit($def);
             $result = true;
         }
     } catch (\Exception $e) {
         $msg = 'Product replication from Odoo is failed. Error: ' . $e->getMessage();
         $this->_logger->emergency($msg);
         $traceStr = $e->getTraceAsString();
         $this->_logger->emergency($traceStr);
         throw $e;
     } finally {
         // transaction will be rolled back if commit is not done (otherwise - do nothing)
         $this->_manTrans->end($def);
     }
     return $result;
 }
开发者ID:praxigento,项目名称:mobi_mod_mage2_odoo,代码行数:42,代码来源:SaleOrderReplicator.php

示例14: productsFromOdoo

 public function productsFromOdoo(Request\ProductsFromOdoo $req)
 {
     $result = new Response\ProductsFromOdoo();
     /* replicate all data in one transaction */
     $def = $this->_manTrans->begin();
     try {
         $ids = $req->getOdooIds();
         /** @var  $inventory Inventory */
         $inventory = $this->_repoOdooInventory->get($ids);
         $this->_doProductReplication($inventory);
         $this->_manTrans->commit($def);
         $result->markSucceed();
     } catch (\Exception $e) {
         $msg = 'Product replication from Odoo is failed. Error: ' . $e->getMessage();
         $this->_logger->emergency($msg);
         $traceStr = $e->getTraceAsString();
         $this->_logger->emergency($traceStr);
         throw $e;
     } finally {
         // transaction will be rolled back if commit is not done (otherwise - do nothing)
         $this->_manTrans->end($def);
     }
     return $result;
 }
开发者ID:praxigento,项目名称:mobi_mod_mage2_odoo,代码行数:24,代码来源:Call.php

示例15: emergency

 public function emergency($message, array $context = [])
 {
     $this->logger->emergency($message, $this->enrichContext($context));
 }
开发者ID:eefjevanderharst,项目名称:Stepup-RA,代码行数:4,代码来源:ProcedureAwareLogger.php


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