Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong background color matching mechanism #178

Open
Bei-Ning opened this issue Jan 26, 2024 · 1 comment
Open

Wrong background color matching mechanism #178

Bei-Ning opened this issue Jan 26, 2024 · 1 comment
Labels

Comments

@Bei-Ning
Copy link

The configuration I used is shown below. Obviously, according to the picture, you can see that the background color will also be colored at the end of the previous line of text, which is obviously incorrect.
image
image
image
image
image

@Bei-Ning
Copy link
Author

You can use the following code to get the same output

import sys
from pathlib import Path

from loguru import logger

logger.remove()

fmt = ("<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green> | "
       "<level>{level: <8}</level>  | "
       "线程:<cyan>{thread}</cyan> <cyan>{thread.name}</cyan> | "
       "进程:<cyan>{process}</cyan> <cyan>{process.name}</cyan> | "
       "<cyan>{module}</cyan>:<cyan>{file.path}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> —— "
       "<level>{message}</level>")

logger.add(Path.home() /  "main.log", format=fmt)
logger.trace("this is trace")
logger.debug("this is debug")
logger.info("this is info")
logger.success("this is success")
logger.warning("this is warning")
logger.error("this is error")
logger.critical("this is critical")

@smirok smirok added the bug label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants