Home > Back-end >  VSCode/Jupyter interfering with Rich (log formatting library for Python) and I see an </> for
VSCode/Jupyter interfering with Rich (log formatting library for Python) and I see an </> for

Time:12-02

Here is what I am seeing, the sign to the left of each output
How do I make that go away? Again I am using VSCode/Python and Jupyter Notebooks

The outputs or like log.info("some text") From what I have read so far it seems to be because rich is using markup that is like HTML and then Jupyter renders this as HTLM or something

import logging
import os
import sys
from rich.logging import RichHandler
def set_logging():
    FORMAT = "Func/Mod:%(funcName)s  %(message)s"
    logging.basicConfig(level=logging.INFO, format=FORMAT, datefmt="[%X]", handlers=[RichHandler(markup=True, show_path=False)])
    if sys.platform.lower() == "win32": 
        os.system('color')
    log = logging.getLogger(__name__)
    #log = logging.getLogger("mylog")
    log.setLevel(logging.INFO)
    return log
if __name__=="__main__":
    log=set_logging()
    log.info("This is a test")
    log.info("This is a test")
    log.info("This is a test")

enter image description here

CodePudding user response:

According to the answer on enter image description here

  • Related