show severity in logs with no-ansi; #616

This commit is contained in:
ed 2025-08-17 09:06:23 +00:00
parent 98d117b8ad
commit d4cf42e760
2 changed files with 9 additions and 2 deletions

View file

@ -1464,7 +1464,14 @@ class SvcHub(object):
fmt = "\033[36m%s \033[33m%-21s \033[0m%s\n"
if self.no_ansi:
fmt = "%s %-21s %s\n"
if c == 1:
fmt = "%s %-21s CRIT: %s\n"
elif c == 3:
fmt = "%s %-21s WARN: %s\n"
elif c == 6:
fmt = "%s %-21s BTW: %s\n"
else:
fmt = "%s %-21s LOG: %s\n"
if "\033" in msg:
msg = RE_ANSI.sub("", msg)
if "\033" in src:

View file

@ -6,7 +6,7 @@
[global]
e2dsa # enable file indexing and filesystem scanning
e2ts # enable multimedia indexing
ansi # enable colors in log messages
ansi # enable colors in log messages (both in logfiles and stdout)
# q, lo: /cfg/log/%Y-%m%d.log # log to file instead of docker