import logging


class 
:
    _shared_state = {}

    def __init__(self):
        self.__dict__ = self._shared_state


class LoggerSetup(BorgSingleton):
    """Logger setup convenience class"""

    DEFAULT_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'

    def __init__(self, logger_name, log_level=logging.INFO, log_file=None, log_format=DEFAULT_FORMAT):
        BorgSingleton.__init__(self)
        self.__logger_name = logger_name

        logger = logging.getLogger(self.__logger_name)
        logger.setLevel(log_level)

        if log_file:
            self.add_log_file(log_file, log_level, log_format)

    def add_log_file(self, log_file, level=logging.INFO, log_format=DEFAULT_FORMAT):
        file_handler = logging.FileHandler(log_file)
        file_handler.setLevel(level)
        file_handler.setFormatter(logging.Formatter(log_format))
        logging.getLogger(self.__logger_name).addHandler(file_handler)

    def get_logger(self):
        return logging.getLogger(self.__logger_name)

BorgSingleton