$formatted_event, 'duration_ms' => $duration_ms, 'tags' => $merged_tags, 'timestamp' => gmdate( 'Y-m-d H:i:s' ), ); // Pretty print JSON for readability $json = wp_json_encode( $output, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ); // Output with visual separator $separator = str_repeat( '=', 80 ); $message = "\n{$separator}\n[MCP OBSERVABILITY EVENT]\n{$separator}\n{$json}\n{$separator}\n"; // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log error_log( $message ); } }