chore: logging defaults not to file
chore: small improvements in Makefile
This commit is contained in:
parent
4633853990
commit
897fac08bc
3 changed files with 5 additions and 5 deletions
6
Makefile
6
Makefile
|
|
@ -67,9 +67,9 @@ test-e2e:
|
||||||
uv run pytest tests/e2e/ -v --tb=short
|
uv run pytest tests/e2e/ -v --tb=short
|
||||||
|
|
||||||
test-e2e-headed:
|
test-e2e-headed:
|
||||||
uv run pytest tests/e2e/ --headed --slowmo 300 -v --tb=short
|
uv run pytest tests/e2e/ --headed --slowmo 100 -v --tb=short
|
||||||
|
|
||||||
test: test-unit test-e2e
|
test: test-stack-up test-unit test-e2e
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Integration test stack (real WireGuard + mock clients + VictoriaMetrics)
|
# Integration test stack (real WireGuard + mock clients + VictoriaMetrics)
|
||||||
|
|
@ -85,7 +85,7 @@ test-stack-up: test-stack-seed
|
||||||
|
|
||||||
test-stack-seed:
|
test-stack-seed:
|
||||||
@echo "[*] Starting infrastructure..."
|
@echo "[*] Starting infrastructure..."
|
||||||
docker compose up -d postgres valkey victoriametrics
|
docker compose up -d postgres valkey victoriametrics mock-oidc mock-saml
|
||||||
@echo "[*] Waiting for Postgres..."
|
@echo "[*] Waiting for Postgres..."
|
||||||
@until docker compose exec -T postgres pg_isready -U wiregui > /dev/null 2>&1; do sleep 1; done
|
@until docker compose exec -T postgres pg_isready -U wiregui > /dev/null 2>&1; do sleep 1; done
|
||||||
@echo "[*] Running migrations..."
|
@echo "[*] Running migrations..."
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ class Settings(BaseSettings):
|
||||||
idp_config_file: str | None = None # path to YAML file with IdP definitions
|
idp_config_file: str | None = None # path to YAML file with IdP definitions
|
||||||
|
|
||||||
# Logging
|
# Logging
|
||||||
log_to_file: bool = True # write timestamped log file to logs/ directory
|
log_to_file: bool = False # write timestamped log file to logs/ directory
|
||||||
|
|
||||||
# App
|
# App
|
||||||
host: str = "0.0.0.0"
|
host: str = "0.0.0.0"
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ def setup_logging(log_to_file: bool = False) -> None:
|
||||||
)
|
)
|
||||||
|
|
||||||
if log_to_file:
|
if log_to_file:
|
||||||
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
timestamp = datetime.now().strftime("%Y%m%d")
|
||||||
logger.add(
|
logger.add(
|
||||||
f"logs/wiregui_{timestamp}.log",
|
f"logs/wiregui_{timestamp}.log",
|
||||||
format="{time:YYYY-MM-DD HH:mm:ss.SSS} | {level:<7} | {name}:{function}:{line} - {message}",
|
format="{time:YYYY-MM-DD HH:mm:ss.SSS} | {level:<7} | {name}:{function}:{line} - {message}",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue