From f5e27341ea60469a20f79188d9211923239528d2 Mon Sep 17 00:00:00 2001 From: Abarna Date: Thu, 8 Oct 2026 14:19:04 +0530 Subject: [PATCH 1/3] src code changes --- src/utils/logger.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/utils/logger.py b/src/utils/logger.py index 380bd1d..136a786 100644 --- a/src/utils/logger.py +++ b/src/utils/logger.py @@ -6,7 +6,7 @@ from colorama import Fore, Style, init as colorama_init -from src.config import config +from src.config import BASE_DIR, config colorama_init(autoreset=True) @@ -54,11 +54,12 @@ def get_logger(level=config.LOG_LEVEL): if level is None: level = "INFO" - # Create log file path - log_file = f"logs/{module_name}.log" + # Create log file path relative to the project root + logs_dir = os.path.join(BASE_DIR, "logs") + log_file = os.path.join(logs_dir, f"{module_name}.log") # Ensure logs directory exists - os.makedirs("logs", exist_ok=True) + os.makedirs(logs_dir, exist_ok=True) formatter = ColoredFormatter( "[%(asctime)s] %(levelname)s [%(filename)s]: %(message)s", @@ -70,7 +71,10 @@ def get_logger(level=config.LOG_LEVEL): handler.setFormatter(formatter) # Global log file handler - global_handler = logging.FileHandler("logs/global.log", encoding="utf-8") + global_handler = logging.FileHandler( + os.path.join(logs_dir, "global.log"), + encoding="utf-8", + ) global_handler.setFormatter(formatter) # Console handler From 0ba6f8de4144bfffc1a95a25e2ab43f4725c9e67 Mon Sep 17 00:00:00 2001 From: Abarna Date: Thu, 8 Oct 2026 16:40:49 +0530 Subject: [PATCH 2/3] fix: use configured assistant name in overlay --- src/ui/overlay.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/overlay.py b/src/ui/overlay.py index 99a4f9c..c1bcf19 100644 --- a/src/ui/overlay.py +++ b/src/ui/overlay.py @@ -53,7 +53,7 @@ def __init__(self, message_timeout=5, exit_callback=None): def setup_ui(self): """Set up the user interface.""" # Main window configuration - self.setWindowTitle("Jasper Assistant") + self.setWindowTitle(f"{config.ASSISTANT_NAME} Assistant") self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint) self.setAttribute(Qt.WA_TranslucentBackground) self.setGeometry( @@ -210,14 +210,15 @@ def process_messages(self): elif msg_type == "response": text = args[0] - self.add_log_message(f"Jasper: {text}", "#00FF00") # Green + self.add_log_message(f"{config.ASSISTANT_NAME}: {text}", "#00FF00") + # Green except Exception as e: logger.error(f"Error processing message: {e}") def start(self): """Start the overlay.""" - self.update_status("Jasper Active", "lightgreen") + self.update_status(f"{config.ASSISTANT_NAME} Active", "lightgreen") def shutdown(self): """Shut down the overlay.""" @@ -241,7 +242,9 @@ def main(): # Demo updating QTimer.singleShot(1000, lambda: overlay.update_status("Listening", "lightblue")) - QTimer.singleShot(2000, lambda: overlay.add_log_message("Jasper, what's the weather today?")) + lambda: overlay.add_log_message( + f"{config.ASSISTANT_NAME}, what's the weather today?" +) QTimer.singleShot(3000, lambda: overlay.update_status("Processing", "yellow")) QTimer.singleShot(4000, lambda: overlay.update_status("Responding", "lightgreen")) QTimer.singleShot( From 3905217d14bf288fcd73c5bc0b95c029c45be3af Mon Sep 17 00:00:00 2001 From: Abarna Date: Thu, 8 Oct 2026 16:48:12 +0530 Subject: [PATCH 3/3] style: format overlay --- src/ui/overlay.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ui/overlay.py b/src/ui/overlay.py index c1bcf19..7f3f7fc 100644 --- a/src/ui/overlay.py +++ b/src/ui/overlay.py @@ -211,7 +211,7 @@ def process_messages(self): elif msg_type == "response": text = args[0] self.add_log_message(f"{config.ASSISTANT_NAME}: {text}", "#00FF00") - # Green + # Green except Exception as e: logger.error(f"Error processing message: {e}") @@ -242,9 +242,7 @@ def main(): # Demo updating QTimer.singleShot(1000, lambda: overlay.update_status("Listening", "lightblue")) - lambda: overlay.add_log_message( - f"{config.ASSISTANT_NAME}, what's the weather today?" -) + lambda: overlay.add_log_message(f"{config.ASSISTANT_NAME}, what's the weather today?") QTimer.singleShot(3000, lambda: overlay.update_status("Processing", "yellow")) QTimer.singleShot(4000, lambda: overlay.update_status("Responding", "lightgreen")) QTimer.singleShot(