feat: enhance logging for character updates and voice cache management

This commit is contained in:
2026-04-07 11:38:35 +08:00
parent b395cb0b98
commit a8d6195cdb
3 changed files with 31 additions and 3 deletions

26
dev.sh
View File

@@ -1,7 +1,27 @@
#!/bin/bash
trap 'kill 0' EXIT
trap 'kill 0' EXIT INT TERM
(cd qwen3-tts-backend && DEV_MODE=true LOG_LEVEL=debug /home/bdim/miniconda3/envs/qwen3-tts/bin/uvicorn main:app --host 0.0.0.0 --port 8000 --reload --log-level debug 2>&1 | sed 's/^/[backend] /') &
(cd qwen3-tts-frontend && npm run dev 2>&1 | sed 's/^/[frontend] /') &
colorize() {
local color="$1" name="$2"
local R=$'\033[0m' DIM=$'\033[90m' YEL=$'\033[33m' RED=$'\033[31m'
local prefix="${color}[${name}]${R} "
while IFS= read -r line; do
if [[ "$line" =~ ^DEBUG ]]; then
printf '%s%s%s%s\n' "$prefix" "$DIM" "$line" "$R"
elif [[ "$line" =~ ^WARNING ]]; then
printf '%s%s%s%s\n' "$prefix" "$YEL" "$line" "$R"
elif [[ "$line" =~ ^(ERROR|CRITICAL) ]]; then
printf '%s%s%s%s\n' "$prefix" "$RED" "$line" "$R"
else
printf '%s%s\n' "$prefix" "$line"
fi
done
}
BLUE=$'\033[34m'
MAGENTA=$'\033[35m'
(cd qwen3-tts-backend && DEV_MODE=true LOG_LEVEL=debug /home/bdim/miniconda3/envs/qwen3-tts/bin/uvicorn main:app --host 0.0.0.0 --port 8000 --reload --log-level debug 2>&1 | colorize "$BLUE" "backend") &
(cd qwen3-tts-frontend && npm run dev 2>&1 | colorize "$MAGENTA" "frontend") &
wait