4485cbf702
Split monolithic files into focused modules: - app/core: settings, logging, lifecycle - app/signaling: websocket server, ICE parser, message models - app/webrtc: peer session, video receiver, frame source - app/vision: pose landmarker wrapper, model config, pose types - app/exercises/dead_bug: detector, metrics, rules, state machine, types - app/rendering: skeleton renderer, status overlay, window display - app/audio: rep announcer - app/diagnostics: perf timer, crash handler - configs: environment-based settings - tests: unit tests for rules, state machine, ICE parser - run.py: entry point
12 lines
341 B
Python
12 lines
341 B
Python
from __future__ import annotations
|
|
|
|
import faulthandler
|
|
from pathlib import Path
|
|
|
|
|
|
def enable_crash_handler(log_dir: str | Path) -> None:
|
|
log_dir = Path(log_dir)
|
|
log_dir.mkdir(parents=True, exist_ok=True)
|
|
crash_log = open(log_dir / "posefit-crash.log", "a", buffering=1)
|
|
faulthandler.enable(file=crash_log, all_threads=True)
|