From 85f3387fd241f6e3394d6f2de82a1d50bae206d5 Mon Sep 17 00:00:00 2001 From: FrankZamora Date: Sun, 7 Dec 2025 17:52:50 -0600 Subject: [PATCH] perf(php): add conditional debug logging to prevent gb logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add ROI_DEBUG constant (default false) to control debug output - create roi_debug_log() function for conditional logging - replace all error_log DEBUG calls with roi_debug_log - keep ERROR logs always active for exception tracking - to enable debug, add define('ROI_DEBUG', true) in wp-config.php this prevents production logs from growing to gb sizes (previous error.log was 4.8gb from constant debug output) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- functions-addon.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/functions-addon.php b/functions-addon.php index 32d96d4a..ba0011c9 100644 --- a/functions-addon.php +++ b/functions-addon.php @@ -1,5 +1,27 @@ render($component); - error_log("ROI Theme DEBUG: render() returned " . strlen($output) . " chars for {$componentName}"); + roi_debug_log("ROI Theme DEBUG: render() returned " . strlen($output) . " chars for {$componentName}"); return $output; } catch (\Exception $e) {