logging: reset style at the end of log line (MR 2272)

Fix a regression from my recent patch that made text like the following
green:
	*** text ****
We also have log messages that only start with ***, but do not end with
***, coming from "pmbootstrap aportgen". They indicate that a new aport
has been generated, but are not a headline for the coming commands.

Fix that the aportgen messages don't reset the colors at the end of the
line, and so the next line would start with the color.

Fixes: 6ba138b6 ("logging: print text between *** in green (MR 2263)")
This commit is contained in:
Oliver Smith 2024-03-10 19:41:15 +01:00
parent 1020bd61ad
commit 96da7f161a
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -52,13 +52,10 @@ class log_handler(logging.StreamHandler):
f"{styles['GREEN']}*** ",
1,
)
.replace(
" ***",
f" ***{styles['END']}",
1,
)
)
msg_col += styles["END"]
stream.write(msg_col)
stream.write(self.terminator)
self.flush()