import logging


class Logger:
    """Small logging wrapper used by the original algorithm modules."""

    def __init__(self, name=None):
        self.name = name
        self.logger = logging.getLogger(self.name)
        self.logger.setLevel(logging.INFO)
        if not self.logger.handlers:
            handler = logging.StreamHandler()
            handler.setFormatter(logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s"))
            self.logger.addHandler(handler)
        self.logger.propagate = False

    def mute(self):
        self.logger.setLevel(logging.CRITICAL + 1)
