當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Writer::error方法代碼示例

本文整理匯總了PHP中Illuminate\Log\Writer::error方法的典型用法代碼示例。如果您正苦於以下問題:PHP Writer::error方法的具體用法?PHP Writer::error怎麽用?PHP Writer::error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Log\Writer的用法示例。


在下文中一共展示了Writer::error方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getInstance

 /**
  * Attempt to instantiate the filter if it exists and has not been ignored.
  *
  * @return null|\Assetic\Filter\FilterInterface
  */
 public function getInstance()
 {
     if (!($class = $this->getClassName())) {
         $this->log->error(sprintf('"%s" will not be applied to asset "%s" due to an invalid filter name.', $this->filter, $this->resource->getRelativePath()));
     }
     if ($this->ignored or is_null($class) or !$this->processRequirements()) {
         return;
     }
     // If the class returned is already implements Assetic\Filter\FilterInterface then
     // we can set the instance directly and not worry about using reflection.
     if ($class instanceof FilterInterface) {
         $instance = $class;
     } else {
         $reflection = new ReflectionClass($class);
         // If no constructor is available on the filters class then we'll instantiate
         // the filter without passing in any arguments.
         if (!$reflection->getConstructor()) {
             $instance = $reflection->newInstance();
         } else {
             $instance = $reflection->newInstanceArgs($this->arguments);
         }
     }
     // Spin through each of the before filtering callbacks and fire each one. We'll
     // pass in an instance of the filter to the callback.
     foreach ($this->before as $callback) {
         if (is_callable($callback)) {
             call_user_func($callback, $instance);
         }
     }
     return $instance;
 }
開發者ID:daveearley,項目名稱:basset,代碼行數:36,代碼來源:Filter.php

示例2: loger

 function loger($level, $file, $line, $string, $ar = NULL)
 {
     // если системный level ниже notice, то при включеном KINT_DUMP, ставим уровень notice
     if ($GLOBALS['KINT_DUMP'] && $this->agiconfig['verbosity_level'] < 2) {
         $this->agiconfig['verbosity_level'] = 2;
     }
     if ($this->agiconfig['verbosity_level'] < $level) {
         return;
     }
     if ($GLOBALS['KINT_DUMP']) {
         ~d("{$level} | {$file} | {$line}");
         if (!is_null($string)) {
             d($string);
         }
         if (!is_null($ar)) {
             d($ar);
         }
         return;
     }
     if (!is_null($string)) {
         $this->agi->verbose($string);
     }
     if (!is_null($ar)) {
         $this->agi->verbose($ar);
     }
     if ((int) $this->agiconfig['logging_write_file'] === 1) {
         $logger = new Writer(new Logger('local'));
         $logger->useFiles($this->config['logs_patch']);
         if (!is_null($ar)) {
             $string .= "\n";
             $string .= var_export($string, true);
         }
         switch ($level) {
             case 'error':
                 $logger->error("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
                 break;
             case 'warning':
                 $logger->warning("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
                 break;
             case 'notice':
                 $logger->notice("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
                 break;
             case 'info':
                 $logger->info("[" . $this->uniqueid . "] [{$file}] [{$line}]:  {$string}");
                 break;
             default:
                 $logger->debug("[" . $this->uniqueid . "] [{$file}] [{$line}]: {$string}");
                 break;
         }
     }
 }
開發者ID:regroute,項目名稱:rr20-backend,代碼行數:51,代碼來源:Rr.php

示例3: errorResponse

 protected function errorResponse($message) : bool
 {
     $this->error = $message;
     $this->logger->error($message);
     return false;
 }
開發者ID:nztim,項目名稱:mailchimp,代碼行數:6,代碼來源:Mailchimp.php

示例4: error

 /**
  * adds url and session to logs
  * @param string $message
  * @param array  $context
  */
 public function error($message, array $context = [])
 {
     $context['url'] = request()->url();
     $context['session'] = session()->all();
     parent::error($message, $context);
 }
開發者ID:younginnovations,項目名稱:aidstream,代碼行數:11,代碼來源:AsWriter.php

示例5: handle

 /**
  * Handle the event.
  *
  * @param $fileName
  */
 public function handle($fileName)
 {
     if (!file_exists($fileName) || false === @unlink($fileName)) {
         $this->writer->error("Could not delete {$fileName} temporary blade template");
     }
 }
開發者ID:vhraban,項目名稱:blade-string-renderer,代碼行數:11,代碼來源:TempTemplateRenderedEventListener.php

示例6: findProfile

 protected function findProfile()
 {
     $adapter_profile = $this->getAdapterProfile();
     $ProfileModel = $this->config['db']['profilemodel'];
     $UserModel = $this->config['db']['usermodel'];
     $user = NULL;
     // Have they logged in with this provider before?
     $profile_builder = call_user_func_array("{$ProfileModel}::where", array('provider', $this->provider));
     $profile = $profile_builder->where('identifier', $adapter_profile->identifier)->first();
     if ($profile) {
         // ok, we found an existing user
         $user = $profile->user()->first();
         $this->logger->debug('Anvard: found a profile, id=' . $profile->id);
     } elseif ($adapter_profile->email) {
         $this->logger->debug('Anvard: could not find profile, looking for email');
         // ok it's a new profile ... can we find the user by email?
         $user_builder = call_user_func_array("{$UserModel}::where", array('email', $adapter_profile->email));
         $user = $user_builder->first();
     }
     // If we haven't found a user, we need to create a new one
     if (!$user) {
         $this->logger->debug('Anvard: did not find user, creating');
         $user = new $UserModel();
         // map in anything from the profile that we want in the User
         $map = $this->config['db']['profiletousermap'];
         foreach ($map as $apkey => $ukey) {
             $user->{$ukey} = $adapter_profile->{$apkey};
         }
         $values = $this->config['db']['uservalues'];
         foreach ($values as $key => $value) {
             if (is_callable($value)) {
                 $user->{$key} = $value($user, $adapter_profile);
             } else {
                 $user->{$key} = $value;
             }
         }
         // @todo this is all very custom ... how to fix?
         $user->username = $adapter_profile->email;
         $user->displayname = $adapter_profile->firstName . " " . $adapter_profile->lastName;
         $user->email = $adapter_profile->email;
         $user->password = uniqid();
         $user->password_confirmation = $user->password;
         $rules = $this->config['db']['userrules'];
         $result = $user->save($rules);
         // will bowman
         $user->saveRoles(array(\Setting::get('users.default_role_id')));
         if (!$result) {
             $this->logger->error('Anvard: FAILED TO SAVE USER');
             return NULL;
         }
     }
     if (!$profile) {
         // If we didn't find the profile, we need to create a new one
         $profile = $this->createProfileFromAdapterProfile($adapter_profile, $user);
     } else {
         // If we did find a profile, make sure we update any changes to the source
         $profile = $this->applyAdapterProfileToExistingProfile($adapter_profile, $profile);
     }
     $result = $profile->save();
     if (!$result) {
         $this->logger->error('Anvard: FAILED TO SAVE PROFILE');
         return NULL;
     }
     $this->logger->info('Anvard: succesful login!');
     return $profile;
 }
開發者ID:hilmysyarif,項目名稱:l4-bootstrap-admin,代碼行數:66,代碼來源:Anvard.php

示例7: updateOrderStatus

 /**
  * @param Request $request
  * @param Writer  $logger
  * @param         $payFastData
  */
 protected function updateOrderStatus(Request $request, Writer $logger, $payFastData)
 {
     $order = Order::where('invoice_no', $request->input('m_payment_id'))->first();
     switch ($payFastData['payment_status']) {
         case self::STATUS_COMPLETE:
             $logger->debug(self::PAYMENT_STATUS_COMPLETE);
             $order->status = strtolower(self::STATUS_COMPLETE);
             break;
         case self::STATUS_FAILED:
             $logger->error(self::PAYMENT_STATUS_FAILED);
             $order->status = strtolower(self::STATUS_FAILED);
             break;
         case self::STATUS_PENDING:
             $logger->debug(self::PAYMENT_STATUS_PENDING);
             $order->status = strtolower(self::STATUS_PENDING);
             break;
         default:
             $logger->error(self::PAYMENT_STATUS_DEFAULT);
             $order->status = self::ERROR;
             break;
     }
     $order->save();
 }
開發者ID:jbmadking,項目名稱:bottlestore,代碼行數:28,代碼來源:PaymentController.php


注:本文中的Illuminate\Log\Writer::error方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。