Files
wh-service/app/Log/StdoutLoggerFactory.php
ykxiao 7423491d9c
Some checks failed
Build Docker / build (push) Has been cancelled
仓库金融单据服务
2025-07-08 15:10:36 +08:00

48 lines
1.1 KiB
PHP

<?php
/**
* Author: ykxiao
* Date: 2025/6/3
* Time: 下午6:03
* Description:
*
* (c) ykxiao <yk_9001@hotmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
declare(strict_types=1);
namespace App\Log;
use Hyperf\Context\ApplicationContext;
use Hyperf\Logger\LoggerFactory;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Log\LoggerInterface;
/**
* Author: ykxiao
* Date: 2025/6/3
* Time: 下午6:04
* Description: 创建一个日志记录器
*
* (c) ykxiao <yk_9001@hotmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
class StdoutLoggerFactory
{
/**
* @param ContainerInterface $container
* @return LoggerInterface
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function __invoke(ContainerInterface $container): LoggerInterface
{
return ApplicationContext::getContainer()->get(LoggerFactory::class)->get();
}
}