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:
2026-09-26 17:36:01 +02:00
co-authored by Claude Opus 5.5
parent e005d83a3d
commit b6984d3f9a
11 changed files with 102 additions and 26 deletions
+2 -2
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace LIT\MCP\Abilities;
use LIT\MCP\Log;
use Throwable;
/**
@@ -20,8 +21,7 @@ final class FollowUp
try {
return $step();
} catch (Throwable $e) {
$message = sprintf('[wp-lit-mcp] %s failed: %s', $context, $e);
error_log($message); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
Log::failure($context, $e);
$warnings[] = $warning;
return null;