helpers: logging: add templates for colors (MR 2252)

Let's make pmbootstrap more colourful! Add some templates to enable
arbitrary colors in log messages.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-10 01:11:34 +02:00 committed by Oliver Smith
parent b860b3efbe
commit 6db7e81a56
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -67,6 +67,26 @@ class log_handler(logging.StreamHandler):
f"{styles['GREEN']}*** ",
1,
)
.replace(
"@BLUE@",
f"{styles['BLUE']}",
)
.replace(
"@YELLOW@",
f"{styles['YELLOW']}",
)
.replace(
"@RED@",
f"{styles['RED']}",
)
.replace(
"@GREEN@",
f"{styles['GREEN']}",
)
.replace(
"@END@",
f"{styles['END']}",
)
)
msg_col += styles["END"]