From bed05707b73532f933f02407200d444f25fd1a4b Mon Sep 17 00:00:00 2001 From: "Elvis M." <125451537+the1Riddle@users.noreply.github.com> Date: Thu, 16 Apr 2026 14:21:05 +0300 Subject: [PATCH] Refactor room name generation in LogMachine to use non numeric values (#5) * Refactor room name generation in LogMachine Updated room name generation logic to avoid potential bugs with non-unique user names. * Remove debug log for room name generation Removed debug console log for auto-generated room name. --- src/LogMachine.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/LogMachine.php b/src/LogMachine.php index 1eb057c..3191d3a 100644 --- a/src/LogMachine.php +++ b/src/LogMachine.php @@ -78,10 +78,12 @@ public static function create(array $config = []): ColorLogger // If no room name is provided, auto-generate one if (empty($centralCfg['room'])) { - $centralCfg['room'] = strtolower($user . '_' . $module . rand(100, 999)); - - // Console log (debug notice for devs) - echo "[LogMachine] No room name provided. Auto-generated: {$centralCfg['room']}\n"; + /** + * this might currently cause a bug, im asumming user names are unique + * if at all there is a future error, just don't be lazy and setup the + * room name lol :P + */ + $centralCfg['room'] = strtolower($user . '_' . $module); } // Push HTTP transport handler