| 1 |
<?php |
| 2 |
/** |
| 3 |
* Black hole. |
| 4 |
* |
| 5 |
* Any record it can handle will be thrown away. |
| 6 |
* |
| 7 |
* @package SolidWP\Performance |
| 8 |
*/ |
| 9 |
|
| 10 |
declare( strict_types=1 ); |
| 11 |
|
| 12 |
namespace SolidWP\Performance\Log\Handlers; |
| 13 |
|
| 14 |
use SolidWP\Performance\Monolog\Handler\AbstractHandler; |
| 15 |
|
| 16 |
/** |
| 17 |
* Black hole. |
| 18 |
* |
| 19 |
* Any record it can handle will be thrown away. |
| 20 |
* |
| 21 |
* @phpstan-import-type Record from \Monolog\Logger |
| 22 |
*/ |
| 23 |
final class Null_Handler extends AbstractHandler { |
| 24 |
|
| 25 |
/** |
| 26 |
* Throw all logs away. |
| 27 |
* |
| 28 |
* @param array $record The monolog Record. |
| 29 |
* |
| 30 |
* @phpstan-param Record $record |
| 31 |
* |
| 32 |
* @return bool |
| 33 |
*/ |
| 34 |
public function handle( array $record ): bool { |
| 35 |
return $record['level'] >= $this->level; |
| 36 |
} |
| 37 |
} |
| 38 |
|