import logging
import sys
from pathlib import Path


class VerilogFrameworkLogger:
    _instance = None
    
    def __new__(cls):
        if cls._instance is None:
            cls._instance = super(VerilogFrameworkLogger, cls).__new__(cls)
            cls._instance._initialized = False
        return cls._instance
    
    def __init__(self):
        if self._initialized:
            return
        
        self.logger = logging.getLogger('VerilogFramework')
        self.logger.setLevel(logging.DEBUG)
        
        formatter = logging.Formatter(
            '%(asctime)s - %(name)s - %(levelname)s - %(message)s',
            datefmt='%Y-%m-%d %H:%M:%S'
        )
        
        console_handler = logging.StreamHandler(sys.stdout)
        console_handler.setLevel(logging.DEBUG)
        console_handler.setFormatter(formatter)
        self.logger.addHandler(console_handler)
        
        self._initialized = True
    
    def get_logger(self):
        return self.logger


def get_logger():
    return VerilogFrameworkLogger().get_logger()
