From d4cf42e760bf5f12382ba89436928064e6c4eb49 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 17 Aug 2025 09:06:23 +0000 Subject: [PATCH] show severity in logs with no-ansi; #616 --- copyparty/svchub.py | 9 ++++++++- docs/examples/docker/basic-docker-compose/copyparty.conf | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/copyparty/svchub.py b/copyparty/svchub.py index 8661bc29..92a797d4 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -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: diff --git a/docs/examples/docker/basic-docker-compose/copyparty.conf b/docs/examples/docker/basic-docker-compose/copyparty.conf index 59820103..ba751549 100644 --- a/docs/examples/docker/basic-docker-compose/copyparty.conf +++ b/docs/examples/docker/basic-docker-compose/copyparty.conf @@ -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