| 1 | <?php |
||
| 8 | class ChannelStreamHandler extends StreamHandler |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $channel; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param string $stream |
||
| 18 | * @param bool|int $level |
||
| 19 | * @param string|null $channel |
||
| 20 | * @param bool $bubble |
||
| 21 | */ |
||
| 22 | 9 | public function __construct( |
|
| 23 | string $stream, |
||
| 24 | int $level = Logger::DEBUG, |
||
| 25 | $channel = null, |
||
| 26 | $bubble = true |
||
| 27 | ) { |
||
| 28 | 9 | parent::__construct($stream, $level, $bubble); |
|
| 29 | |||
| 30 | 9 | $formatter = new Formatter( |
|
| 31 | 9 | null, |
|
| 32 | 9 | null, |
|
| 33 | 9 | false, |
|
| 34 | 9 | true |
|
| 35 | ); |
||
| 36 | |||
| 37 | 9 | $this->setFormatter( |
|
| 38 | 9 | $formatter |
|
| 39 | ); |
||
| 40 | |||
| 41 | 9 | $this->channel = $channel; |
|
| 42 | 9 | } |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @param string $channel |
||
| 46 | */ |
||
| 47 | 7 | public function setChannel(string $channel) |
|
| 51 | |||
| 52 | /** |
||
| 53 | * {@inheritdoc} |
||
| 54 | */ |
||
| 55 | 7 | public function isHandling(array $record) : bool |
|
| 77 | } |
||
| 78 |