Open Bei-Ning opened 5 months ago
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")
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](https://github.com/JetBrains/ideolog/assets/120180884/965154cf-3c56-4bd4-9c44-a28d06ae64f6)