Skip to content

Commit

Permalink
html: Show messages in monospace/preformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakuje committed Sep 13, 2024
1 parent 243d483 commit 9067ff9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions SCAutolib/models/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def emit(self, record: logging.LogRecord) -> None:
Do whatever it takes to actually log the specified logging record.
"""
custom_record = copy.deepcopy(record)
custom_record.msg = str(record.msg).rstrip().replace("\n", "<br>\n")
return super().emit(custom_record)


Expand Down Expand Up @@ -291,13 +290,13 @@ def __init__(self, wait_time: float = 5, res_dir_name: str = None):
"initial-scale=1.0\">\n"
"<title>Test Results</title>\n"
"</head>\n"
"<body style=\"background-color:#000\">\n"
"<body style=\"background-color:#000;\">\n"
)

fmt = "<span style=\"color:white;\">"
fmt += "%(name)s:%(module)s.%(funcName)s.%(lineno)d </span>"
fmt += "<span style=\"color:royalblue;\">[%(levelname)s] </span>"
fmt += "<span style=\"color:limegreen;\">%(message)s</span>"
fmt += "<pre style=\"color:limegreen;\">%(message)s</pre>"
self.fileHandler = HTMLFileHandler(self.html_file)
self.fileHandler.setLevel(logging.DEBUG)
self.fileHandler.setFormatter(
Expand Down

0 comments on commit 9067ff9

Please sign in to comment.