mirror of
https://github.com/friendica/friendica
synced 2025-01-31 20:59:47 +00:00
Create new LoggerFactory
This commit is contained in:
parent
275b383be7
commit
9bcb470caa
2 changed files with 48 additions and 0 deletions
24
src/Core/Logger/Factory/LoggerFactory.php
Normal file
24
src/Core/Logger/Factory/LoggerFactory.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
// Copyright (C) 2010-2024, the Friendica project
|
||||
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Friendica\Core\Logger\Factory;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\NullLogger;
|
||||
|
||||
/**
|
||||
* The logger factory for the core logging instances
|
||||
*/
|
||||
final class LoggerFactory
|
||||
{
|
||||
public function create(): LoggerInterface
|
||||
{
|
||||
return new NullLogger();
|
||||
}
|
||||
}
|
24
tests/Unit/Core/Logger/Factory/LoggerFactoryTest.php
Normal file
24
tests/Unit/Core/Logger/Factory/LoggerFactoryTest.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
// Copyright (C) 2010-2024, the Friendica project
|
||||
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Friendica\Test\Unit\Core\Logger\Factory;
|
||||
|
||||
use Friendica\Core\Logger\Factory\LoggerFactory;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class LoggerFactoryTest extends TestCase
|
||||
{
|
||||
public function testLoggerFactoryCreateReturnsPsrLogger(): void
|
||||
{
|
||||
$factory = new LoggerFactory();
|
||||
|
||||
$this->assertInstanceOf(LoggerInterface::class, $factory->create());
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue