'Configures logging based on --debug= command line switch
We do not have as many levels as the original boottool(.pl) had, but
we accept the same range of parameters and adjust it to our levels.'

def _configure_logging(self):

    log_map = {0: logging.WARNING, 1: logging.INFO, 2: logging.DEBUG}
    try:
        level = int(self.opts.debug)
    except ValueError:
        level = 0
    max_level = max(log_map.keys())
    if (level > max_level):
        level = max_level
    if os.environ.has_key('BOOTTOOL_DEBUG_RUN'):
        logging_level = logging.DEBUG
    else:
        logging_level = log_map.get(level)
    logging.basicConfig(level=logging_level, format=LOGGING_FORMAT)
