Add timestamp to ESPHome dashboard/cli logs (#2455)

This commit is contained in:
Alex Iribarren 2021-10-06 21:56:07 +02:00 committed by GitHub
parent 22e3bc7cfe
commit d34a1c3ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,7 @@ def color(col: str, msg: str, reset: bool = True) -> bool:
class ESPHomeLogFormatter(logging.Formatter):
def __init__(self):
super().__init__(fmt="%(levelname)s %(message)s", datefmt="%H:%M:%S", style="%")
super().__init__(fmt="%(asctime)s %(levelname)s %(message)s", style="%")
def format(self, record):
formatted = super().format(record)