feat: CI/CD pipeline setup complete - Ansible playbooks updated, secrets configured, workflow ready
This commit is contained in:
30
src/Framework/Logging/Handlers/NullHandler.php
Normal file
30
src/Framework/Logging/Handlers/NullHandler.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Logging\Handlers;
|
||||
|
||||
use App\Framework\Logging\LogHandler;
|
||||
use App\Framework\Logging\LogRecord;
|
||||
|
||||
/**
|
||||
* NullHandler discards all log entries without any output
|
||||
*
|
||||
* Use Cases:
|
||||
* - MCP Server mode (prevents log interference with JSON-RPC)
|
||||
* - Testing environments where logging should be suppressed
|
||||
* - Performance-critical paths where logging overhead is unacceptable
|
||||
*/
|
||||
final readonly class NullHandler implements LogHandler
|
||||
{
|
||||
public function isHandling(LogRecord $record): bool
|
||||
{
|
||||
// Accept all levels but discard them
|
||||
return true;
|
||||
}
|
||||
|
||||
public function handle(LogRecord $record): void
|
||||
{
|
||||
// Discard all log entries - no output
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user