def get_loglevel(level):
try:<EOL><INDENT>return [logging.DEBUG, logging.INFO, logging.WARN][level]<EOL><DEDENT>except IndexError:<EOL><INDENT>return logging.INFO<EOL><DEDENT>
Set log level.

>>> assert get_loglevel(2) == logging.WARN
>>> assert get_loglevel(10) == logging.INFO