#!/usr/bin/env bash

set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
LOG_DIR="${ROOT_DIR}/logs"
LOG_FILE="${LOG_DIR}/docker-services.log"

mkdir -p "${LOG_DIR}"

cd "${ROOT_DIR}"
docker compose logs --timestamps --no-color "$@" | tee "${LOG_FILE}"

echo
echo "Saved service logs to ${LOG_FILE}"
