Skip to content

Commit ce2ca48

Browse files
committed
Enable live logs is log_cli_level is passed/set explicitly
1 parent ddfff56 commit ce2ca48

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

_pytest/logging.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ def __init__(self, config):
337337
"""
338338
self._config = config
339339

340+
# enable live logs if log_cli_level is explicitly set
341+
log_cli_level = get_actual_log_level(self._config, 'log_cli_level', 'log_level')
342+
if log_cli_level is not None:
343+
# enable live logs if log_cli_level is explicitly set
344+
config._inicache['log_cli'] = config._parser._inidict['log_cli'] = True
340345
# enable verbose output automatically if live logging is enabled
341346
if self._config.getini('log_cli') and not config.getoption('verbose'):
342347
# sanity check: terminal reporter should not have been loaded at this point

changelog/3175.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enable live logs is log_cli_level is passed/set explicitly

0 commit comments

Comments
 (0)