modify plugin name

This commit is contained in:
2022-02-23 16:32:08 +08:00
parent fa66eef192
commit 99c824c467
37 changed files with 317 additions and 937 deletions
+42
View File
@@ -0,0 +1,42 @@
<?php
namespace Kiri\Error;
use Kiri\Abstracts\Logger;
use Kiri\Exception\ConfigException;
class StdoutLogger extends Logger implements StdoutLoggerInterface
{
private array $errors = [];
/**
* @param $message
* @param string $model
* @return bool
* @throws ConfigException
*/
public function addError($message, string $model = 'app'): bool
{
$this->error($model, [$message]);
if ($message instanceof \Exception) {
$this->errors[$model] = $message->getMessage();
} else {
$this->errors[$model] = $message;
}
return false;
}
/**
* @param string $model
* @return mixed
*/
public function getLastError(string $model = 'app'): mixed
{
return $this->errors[$model] ?? 'Unknown error.';
}
}