1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-11 23:54:04 +02:00

Add a WithMonologChannel attribute (#1847)

This attribute is meant to be used by frameworks / integrations to
choose which logger instance to inject in a class when they manage
several channels, if they decide to use it.
This attribute will have no effect in Monolog itself as the wiring of
the logger in other classes is not managed by Monolog.
This commit is contained in:
Christophe Coevoet
2023-10-25 15:02:25 +02:00
committed by GitHub
parent 9546d94bdc
commit e545d0f444
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
<?php
namespace Monolog\Attribute;
use PHPUnit\Framework\TestCase;
class WithMonologChannelTest extends TestCase
{
public function test(): void
{
$attribute = new WithMonologChannel('fixture');
$this->assertSame('fixture', $attribute->channel);
}
}