Delgan / loguru

Python logging made (stupidly) simple

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When running pytest use cases using Pytest-xDist multiprocesses. The color of the loguru log output from the console is all red.

lgrlucky opened this issue · comments

commented

When running pytest use cases using Pytest-xDist multiprocesses. The color of the loguru log output from the console is all red,

but without using pytest-xdist, there is no problem with the color of the log in the console:
image

Here is my loguru configuration:
image

This is the corresponding package version
image

I have tried the combination of many versions, such as Pytest-xdist of 2.5.0 and pytest of 6.2.5 and 8.0.0, but nothing has changed.
If it is convenient, please help me see what the cause of this problem is, and it does not affect the function, but for OCD, the red log full screen makes me very uncomfortable .ThanK

This is a problem with pytest or pytest-xidst.

In the code you shared, the format of the logger does not contain any color. Therefore, Loguru should not affect the colors of the Pytest output.

Maybe try by adding colorize=False to your sink configuration.