Add --log-interval flag and timestamp capture logs

Follow-ups from the capture-reliability review:
- All server-side capture log lines are now prefixed with a local
  timestamp (YYYY-MM-DD HH:MM:SS) for easier correlation.
- New --log-interval SECONDS CLI flag (default 60) tunes the
  "Capture alive" heartbeat interval; passed through to CaptureManager.

Stays on 1.22.0 (backend-only). 369 tests pass.
This commit is contained in:
catarrh committed 2026-08-26 22:35:59 +03:00
1 parent 51e1b4ae08
commit 6887e53144
3 files changed
+33 -24

No files matched your search

+6 -3
View File
@@ -35,7 +35,10 @@ def main():
p.add_argument('--capture', choices=['gsmtap', 'direct', 'disabled'], default='gsmtap',
help='Capture mode: gsmtap (listen UDP 4729), direct (SIMtrace2 USB), or disabled (no capture)')
p.add_argument('--gsmtap-port', type=int, default=4729,
help='UDP port for GSMTAP listener (default: 4729)')
help='UDP port for GSMTAP listener (default: 4729)')
p.add_argument('--log-interval', type=float, default=60.0,
help='Seconds between capture liveness heartbeat logs '
'(default: 60.0)')
p.add_argument('--web-dir', default=_default_web_dir(), metavar='PATH',
help='Directory with the simtrace-analyser PWA static files to serve (default: <repo>/frontend)')
args = p.parse_args()
@@ -45,10 +48,10 @@ def main():
capture = None
if args.capture == 'gsmtap':
backend = GsmtapListener(bind_port=args.gsmtap_port)
capture = CaptureManager(backend, db)
capture = CaptureManager(backend, db, log_interval=args.log_interval)
elif args.capture == 'direct':
backend = DirectSniffer()
capture = CaptureManager(backend, db)
capture = CaptureManager(backend, db, log_interval=args.log_interval)
RequestHandler.db = db
RequestHandler.capture = capture