refactor: update log level icon and enhance log parsing pattern

- 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.
This commit is contained in:
g0ldyy
2025-12-10 18:20:34 +01:00
parent 61ab23472b
commit 339cce72bd
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ CUSTOM_LOG_LEVELS = {
},
"DATABASE": {
"color": "#5aa5d9",
"icon": "🗄️",
"icon": "💾",
"loguru_color": "<fg #5aa5d9>",
"no": 32,
},
+1 -1
View File
@@ -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: