def get_actual_log_level(config, *setting_names):
for setting_name in setting_names:<EOL><INDENT>log_level = config.getoption(setting_name)<EOL>if log_level is None:<EOL><INDENT>log_level = config.getini(setting_name)<EOL><DEDENT>if log_level:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return<EOL><DEDENT>if isinstance(log_level, six.string_types):<EOL><INDENT>log_level = log_level.upper()<EOL><DEDENT>try:<EOL><INDENT>return int(getattr(logging, log_level, log_level))<EOL><DEDENT>except ValueError:<EOL><INDENT>raise pytest.UsageError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(log_level, setting_name)<EOL>)<EOL><DEDENT>
Return the actual logging level.