question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I get live logs with loguru and pytest?

See original GitHub issue

I have tried many of the options like --log-cli-level, --log-level but I’m not able to run my tests seeing the output of the logs live.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Delgancommented, Mar 4, 2022

You should try with the --capture=no option.

0reactions
izikeroscommented, Dec 20, 2022

You should try with the --capture=no option.

I had a problem with loguru live logs when using PyCharm’s test runner. Adding --capture=no in Additional Arguments of the runner configuration solved the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Switching from standard logging to loguru
The main difference is that standard logging requires the user to explicitly instantiate named Logger and configure them with Handler , Formatter and...
Read more >
How to Add Loguru Support to Pytest in Python - YouTube
In this pytest tutorial, you will learn how to loguru support to pytest.First, we will see how to test log messages using pytest's...
Read more >
How to manage logging — pytest documentation
Live Logs ¶ ... By setting the log_cli configuration option to true , pytest will output logging records as they are emitted directly...
Read more >
A Complete Guide to Logging in Python with Loguru
Learn how to install, configure, and use the Loguru framework for logging in Python applications.
Read more >
Testing logging output with pytest - python - Stack Overflow
I don't know why this didn't work when I tried it before, but this solution works for me now: In test_module.py: import logging...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found