This commit is contained in:
2023-04-17 10:19:00 +08:00
parent 00b6d28196
commit e3d990077d
5 changed files with 10 additions and 45 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ use Exception;
use Kiri;
use Kiri\Di\LocalService;
use ReflectionException;
use Kiri\Error\{StdoutLogger, StdoutLoggerInterface};
use Kiri\Error\StdoutLogger;
use Kiri\Exception\{InitException};
use Psr\Log\LoggerInterface;
use Kiri\Events\EventProvider;
@@ -54,12 +54,12 @@ abstract class BaseMain extends Component
/**
* @param array $mapping
* @param array $components
* @throws ReflectionException
*/
public function mapping(array $mapping, array $components)
{
$di = Kiri::getDi();
$di->set(StdoutLoggerInterface::class, StdoutLogger::class);
$di->set(LoggerInterface::class, Logger::class);
$di->set(LoggerInterface::class, StdoutLogger::class);
foreach ($mapping as $interface => $class) {
$di->set($interface, $class);
}
+1 -10
View File
@@ -34,7 +34,6 @@ class Logger implements LoggerInterface
/**
* @param string $message
* @param array $context
* @throws ConfigException
*
* 紧急情况
*/
@@ -48,7 +47,6 @@ class Logger implements LoggerInterface
/**
* @param string $message
* @param array $context
* @throws ConfigException
*
* 应该警惕的
*/
@@ -62,7 +60,6 @@ class Logger implements LoggerInterface
/**
* @param string $message
* @param array $context
* @throws ConfigException
*
* 关键性的日志
*/
@@ -76,7 +73,6 @@ class Logger implements LoggerInterface
/**
* @param string $message
* @param array $context
* @throws ConfigException
*/
public function error($message, array $context = [])
{
@@ -88,7 +84,6 @@ class Logger implements LoggerInterface
/**
* @param string $message
* @param array $context
* @throws ConfigException
*/
public function warning($message, array $context = [])
{
@@ -99,7 +94,6 @@ class Logger implements LoggerInterface
/**
* @param string $message
* @param array $context
* @throws ConfigException
*/
public function notice($message, array $context = [])
{
@@ -111,7 +105,6 @@ class Logger implements LoggerInterface
/**
* @param string $message
* @param array $context
* @throws ConfigException
*/
public function info($message, array $context = [])
{
@@ -123,7 +116,6 @@ class Logger implements LoggerInterface
/**
* @param string $message
* @param array $context
* @throws ConfigException
*/
public function debug($message, array $context = [])
{
@@ -136,8 +128,7 @@ class Logger implements LoggerInterface
* @param mixed $level
* @param string $message
* @param array $context
* @throws ConfigException
* @throws Exception
* @throws
*/
public function log($level, $message, array $context = [])
{