本文整理汇总了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;
}
示例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;
}
}
}
示例3: errorResponse
protected function errorResponse($message) : bool
{
$this->error = $message;
$this->logger->error($message);
return false;
}
示例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);
}
示例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");
}
}
示例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;
}
示例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();
}