Delgan / Delgan/loguru

When using loguru and pytest-loguru plugin, all logs (all level log)will output in terminal even though I add option `--log-level=INFO` or `--log-cli-level=INFO`

Open
#751 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
24.1k
Forks
817
Avg merge
7h 35m
Merged PRs (30d)
4

Description

When using default logging lib, running pytest -s -v test_e2e.py will not output logs and if running pytest -s -v test_e2e.py --log-cli-level=INFO --capture=no will output INFO level logs.

But when using loguru and pytest-loguru plugin , runing two commands above will output all logs

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with test_e2e.py using pytest -s -v and the --log-cli-level=INFO or --log-level=INFO options, comparing loguru with the default logging library. Inspect the pytest-loguru integration and verify that logs below INFO are suppressed while INFO-level logs remain visible when the appropriate option is provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.