Files

19 lines
485 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# logs.sh — обёртка над `docker compose logs` с фильтром сервиса.
cmd_logs() {
local svc=""
while [[ $# -gt 0 ]]; do
case "$1" in
-f|--follow) shift; ;;
*) svc="$1"; shift; ;;
esac
done
if [[ -n "$svc" ]]; then
run_compose logs --tail=200 "$svc" || die "logs: service not found or not running: $svc" 1
else
run_compose logs --tail=200 || die "logs: cannot fetch logs (not deployed yet?)" 1
fi
}