diff --git a/src/_pytest/logging.py b/src/_pytest/logging.py index 7db4f95f2..3220a936e 100644 --- a/src/_pytest/logging.py +++ b/src/_pytest/logging.py @@ -847,7 +847,7 @@ class LoggingPlugin: @hookimpl(wrapper=True) def pytest_runtest_setup(self, item: nodes.Item) -> Generator[None, None, None]: - if self.log_file_verbose: + if self.log_file_verbose and int(self.log_file_verbose) >= 1: old_log_file_formatter = self.log_file_handler.formatter self.log_file_handler.setFormatter(logging.Formatter()) self.log_file_handler.emit(logging.LogRecord('N/A', logging.INFO, 'N/A', 0, f"Running at {item.nodeid}", None, None))