def add_arguments(parser, default_level=logging.INFO):
	"""
	Add arguments to an ArgumentParser or OptionParser for purposes of
	grabbing a logging level.
	"""
	adder = (
		getattr(parser, 'add_argument', None)
		or getattr(parser, 'add_option')
	)
	adder(
		'-l', '--log-level', default=default_level, 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.