modify plugin name

This commit is contained in:
2022-06-16 17:38:23 +08:00
parent 10de6b5246
commit 4daad7d111
22 changed files with 1206 additions and 70 deletions
+5 -5
View File
@@ -28,11 +28,9 @@ class Logger implements LoggerInterface
const DEBUG = 'debug';
const LOGGER_LEVELS = [Logger::EMERGENCY, Logger::ALERT, Logger::CRITICAL, Logger::ERROR, Logger::WARNING, Logger::NOTICE, Logger::INFO, Logger::DEBUG];
/**
* @param string $message
* @param array $context
@@ -158,12 +156,11 @@ class Logger implements LoggerInterface
}
/**
* @return void
* @throws Exception
*/
public function flush()
public function flush(): void
{
$this->removeFile(storage());
}
@@ -173,7 +170,7 @@ class Logger implements LoggerInterface
* @param string $dirname
* @return void
*/
private function removeFile(string $dirname)
private function removeFile(string $dirname): void
{
$paths = new DirectoryIterator($dirname);
/** @var DirectoryIterator $path */
@@ -197,6 +194,9 @@ class Logger implements LoggerInterface
*/
private function _string($message, $context): string
{
if ($context instanceof \Throwable) {
$context = ['file' => $context->getFile(), 'line' => $context->getLine()];
}
if (!empty($context)) {
return $message . ' ' . PHP_EOL . print_r($context, true) . PHP_EOL;
}