diff --git a/src/ui/overlay.py b/src/ui/overlay.py index 99a4f9c..7f3f7fc 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,7 @@ 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( 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