def add_arguments(parser):
 adder = (getattr(parser, 'add_argument', None) or getattr(parser, 'add_option'))
 adder('-l', '--log-level', default=logging.INFO, type=log_level, help='Set log level (DEBUG, INFO, WARNING, ERROR)')

def add_arguments ( parser ) : adder = ( getattr ( parser , 'add_argument' , None ) or getattr ( parser , 'add_option' ) ) adder ( '-l' , '--log-level' , default = logging . INFO , type = log_level , help = 'Set log level (DEBUG, INFO, WARNING, ERROR)' )
add arguments to an argumentparser or optionparser for purposes of grabbing a logging level .