JetBrains / ideolog

Interactive viewer for '.log' files.
MIT License
251 stars 54 forks source link

Wrong background color matching mechanism #178

Open Bei-Ning opened 5 months ago

Bei-Ning commented 5 months ago

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 commented 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")