Skip to content

The colors of the logs are not displayed using --capture=tee-sys #11270

Open
@nck974

Description

  • a detailed description of the bug or problem you are having:

When I use --capture=tee-sys instead of -s the logs are not colored anymore. Example:
image

The source of the issue is that I want to capture to logs to put them in an HTML report, but I also want to see live what is going on in the test as it takes a long time to execute and I need to check the progress. Not having the colors makes it harder to read.

  • output of pip list from the virtual environment you are using
colorama==0.4.6
exceptiongroup==1.1.2
iniconfig==2.0.0     
loguru==0.7.0        
packaging==23.1      
pluggy==1.2.0        
pytest==7.4.0        
tomli==2.0.1
win32-setctime==1.1.0
  • pytest and operating system versions
Windows 10:
Python 3.10.10
  • minimal example if possible:
"""
My test module
"""
from loguru import logger


def test_color():
    """
    My test
    """
    logger.info("My colored log")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    plugin: capturerelated to the capture builtin pluginplugin: loggingrelated to the logging builtin plugintype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions