mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 06:06:33 +00:00
[dashboard] Fix logging colors (#8984)
This commit is contained in:
parent
a225d6881f
commit
19ec922e28
@ -59,7 +59,13 @@ class ESPHomeLogFormatter(logging.Formatter):
|
||||
"ERROR": AnsiFore.RED.value,
|
||||
"CRITICAL": AnsiFore.RED.value,
|
||||
}.get(record.levelname, "")
|
||||
return f"{prefix}{formatted}{AnsiStyle.RESET_ALL.value}"
|
||||
message = f"{prefix}{formatted}{AnsiStyle.RESET_ALL.value}"
|
||||
if CORE.dashboard:
|
||||
try:
|
||||
message = message.replace("\033", "\\033")
|
||||
except UnicodeEncodeError:
|
||||
pass
|
||||
return message
|
||||
|
||||
|
||||
def setup_log(
|
||||
|
Loading…
x
Reference in New Issue
Block a user