refactor: one logging helper LIT\MCP\Log (M6)
Log::failure(context, detail) keeps the '[wp-lit-mcp] <context> failed: <detail>' format of the nine former error_log() sites; Log::line() covers the change log line. One phpcs ignore instead of eleven. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ namespace LIT\MCP\Server;
|
||||
use LIT\MCP\Abilities\ExposurePolicy;
|
||||
use LIT\MCP\Guides\InstructionsBuilder;
|
||||
use LIT\MCP\Integrations\IntegrationRegistry;
|
||||
use LIT\MCP\Log;
|
||||
use LIT\MCP\Plugin;
|
||||
use WP\MCP\Core\McpAdapter;
|
||||
use WP\MCP\Infrastructure\ErrorHandling\ErrorLogMcpErrorHandler;
|
||||
@@ -131,8 +132,7 @@ final class ServerRegistrar
|
||||
$result = ($this->createAdapterServer)($args);
|
||||
|
||||
if (is_wp_error($result)) {
|
||||
$message = '[wp-lit-mcp] MCP server registration failed: ' . $result->get_error_message();
|
||||
error_log($message); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
|
||||
Log::failure('MCP server registration', $result->get_error_message());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user