In the current pytest 5.3.2, --log-cli can only be configured via ini.
It will be great to support --log-cli as a command line option.
The option override option is suppose to be used for that
Alternatively, you can also use --log-cli-level=LEVEL.
@jiasli this is intentional, because the -o allows you to change any ini option through the command line:
pytest -o log_cli=true
The original logging plugin contained ini option alternatives for every command-line option, and when it was introduced into pytest's core we kept all the original options/command-line arguments for backward compatibility.
Currently we try to avoid having duplicated command-line and configuration options, because the -o switch solves this nicely. The --log-cli was added after the logging plugin introduction to the core, so it follows this new approach.
Many thanks for the detailed explanation. 馃槂
Most helpful comment
Alternatively, you can also use
--log-cli-level=LEVEL.