import logging


def set_log_level(level: str):
    logging.basicConfig(
        level = logging.DEBUG if level == 'debug' else logging.INFO,
        format = '%(asctime)s - %(name)s - %(message)s',
        datefmt = '%H:%M:%S'
    )


# silence some debug messages
logging.getLogger('matplotlib.font_manager').setLevel(logging.WARNING)
logging.getLogger('matplotlib.ticker').setLevel(logging.WARNING)
logging.getLogger('matplotlib.pyplot').setLevel(logging.WARNING)
logging.getLogger('matplotlib.colorbar').setLevel(logging.WARNING)
