本文整理汇总了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];
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
}