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


PHP Tlog::error方法代码示例

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


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

示例1: log

 protected function log($level, $message)
 {
     if ($this->usePropel) {
         switch ($level) {
             case 'debug':
                 $this->logger->debug($message);
                 break;
             case 'info':
                 $this->logger->info($message);
                 break;
             case 'notice':
                 $this->logger->notice($message);
                 break;
             case 'warning':
                 $this->logger->warning($message);
                 break;
             case 'error':
                 $this->logger->error($message);
                 break;
             case 'critical':
                 $this->logger->critical($message);
                 break;
         }
     } else {
         $this->logs[] = [$level, $message];
     }
 }
开发者ID:jeremyFreeAgent,项目名称:thelia,代码行数:27,代码来源:Update.php

示例2: copyFile

 /**
  * @param $pathToFile
  * @param $destination
  * @param $isOnline
  * @return $this
  * @throws \ErrorException
  */
 public function copyFile($pathToFile, $destination, $isOnline)
 {
     if ($isOnline) {
         /**
          * It's an online file
          */
         $this->getFileDownloader()->download($pathToFile, $destination);
     } else {
         /**
          * It's a local file
          */
         if (!is_file($pathToFile)) {
             $this->throwFileNotFound($pathToFile);
         } elseif (!is_readable($pathToFile)) {
             throw new FileNotReadableException($this->translator->trans("The file %file is not readable", ["%file" => $pathToFile]));
         }
         if (!copy($pathToFile, $destination)) {
             $translatedErrorMessage = $this->translator->trans("An error happend while copying %prev to %dest", ["%prev" => $pathToFile, "%dest" => $destination]);
             $this->logger->error($translatedErrorMessage);
             throw new \ErrorException($translatedErrorMessage);
         }
     }
     return $this;
 }
开发者ID:margery,项目名称:thelia,代码行数:31,代码来源:AbstractArchiveBuilder.php

示例3: getWebPaymentDetails

 /**
  * @see : 3.2.(1 & 2) PAYLINE-GUIDE-Descriptif des appels webservices.
  * @param $token
  * @return array
  */
 public function getWebPaymentDetails($token)
 {
     $reference = '';
     try {
         $results = $this->payline->getWebPaymentDetails(['version' => self::VERSION, 'token' => $token]);
         $code = $results['result']['code'];
         $message = $results['result']['longMessage'];
         $reference = $results['order']['ref'];
         if (!in_array($code, ['00000', '01001'])) {
             $this->logger->error("[PAYLINE ERROR][{$code}] : {$message}", ['reference' => $reference]);
             return false;
         }
         return true;
     } catch (\Exception $e) {
         $this->logger->error($e->getMessage(), ['reference' => $reference]);
     }
     return false;
 }
开发者ID:Alban-io,项目名称:Payline,代码行数:23,代码来源:PaylineManager.php

示例4: processUpdateOrders

 public function processUpdateOrders(OrderEvent $event)
 {
     if ($event->getOrder()->getPaymentModuleId() == $this->shoppingFluxPaymentModuleId) {
         $status = $event->getStatus();
         $allowedStatus = [$sentStatusId = OrderStatusQuery::getSentStatus()->getId(), OrderStatusQuery::getCancelledStatus()->getId()];
         if (in_array($status, $allowedStatus)) {
             $order = $event->getOrder();
             $mode = ShoppingFluxConfigQuery::getProd() ? UpdateOrders::REQUEST_MODE_PRODUCTION : UpdateOrders::REQUEST_MODE_SANDBOX;
             $api = new UpdateOrders(ShoppingFluxConfigQuery::getToken(), $mode);
             $request = new Request("UpdateOrders");
             $request->addOrder(["IdOrder" => $order->getRef(), "Marketplace" => $order->getTransactionRef(), "Status" => $status === $sentStatusId ? "Shipped" : "Canceled"]);
             $response = $api->setRequest($request)->getResponse();
             if ($response->isInError()) {
                 $this->logger->error($response->getFormattedError());
             }
             if (!$api->compareResponseRequest()) {
                 $errorMessage = "Bad response from ShoppingFlux: " . $response->getGroup("UpdateOrders")->C14N();
                 $this->logger->error($errorMessage);
             }
         }
     }
 }
开发者ID:ThomasArnaud,项目名称:ShoppingFlux,代码行数:22,代码来源:ApiCall.php


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