From 339cce72bd038a532f5a221a08a01fc6e023f3bb Mon Sep 17 00:00:00 2001 From: g0ldyy <153996346+g0ldyy@users.noreply.github.com> Date: Wed, 10 Dec 2025 18:20:34 +0100 Subject: [PATCH] refactor: update log level icon and enhance log parsing pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed the database log level icon from "πŸ—„οΈ" to "πŸ’Ύ" for better representation. - Modified the log parsing regex pattern to allow for more flexible matching of log levels. --- comet/core/log_levels.py | 2 +- comet/core/logger.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/comet/core/log_levels.py b/comet/core/log_levels.py index b54b233..81da5bd 100644 --- a/comet/core/log_levels.py +++ b/comet/core/log_levels.py @@ -28,7 +28,7 @@ CUSTOM_LOG_LEVELS = { }, "DATABASE": { "color": "#5aa5d9", - "icon": "πŸ—„οΈ", + "icon": "πŸ’Ύ", "loguru_color": "", "no": 32, }, diff --git a/comet/core/logger.py b/comet/core/logger.py index 58e7b5f..dff6a69 100644 --- a/comet/core/logger.py +++ b/comet/core/logger.py @@ -100,7 +100,7 @@ class LoguruHandler: if message.strip(): # Try to extract timestamp, level, module, function, and message # This is a simplified parser for loguru format - pattern = r"(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) \| ([πŸŒ πŸ‘ΎπŸ‘»πŸŽ¬πŸ”’πŸ­πŸ“°πŸ•ΈοΈβš οΈβŒπŸ’€]?) ?(\w+) \| (\w+)\.(\w+) - (.+)" + pattern = r"(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) \| (.*?) ?(\w+) \| (\w+)\.(\w+) - (.+)" match = re.match(pattern, message.strip()) if match: