Files
ALPHA-TRAIN2/services_vulnerable/arena-battle/logs/monitor.py
T
bobiqq c231be0094
build-and-push / detect (push) Successful in 7s
build-and-push / build (${{ fromJSON(needs.detect.outputs.services) }}) (push) Failing after 3m33s
services
2026-08-26 11:04:23 +03:00

35 lines
744 B
Python
Executable File

#!/usr/bin/env python3
"""
Simple log tail for Arena Battle Server
"""
import sys
import time
from pathlib import Path
LOG_FILE = Path(__file__).parent.parent / "logs" / "server.log"
def tail_log():
if not LOG_FILE.exists():
print(f"Log file not found: {LOG_FILE}")
print("Start the server first.")
sys.exit(1)
print(f"=== Tail {LOG_FILE} (Ctrl+C to stop) ===")
with open(LOG_FILE, "r") as f:
f.seek(0, 2)
while True:
line = f.readline()
if line:
print(line.strip())
else:
time.sleep(0.5)
if __name__ == "__main__":
try:
tail_log()
except KeyboardInterrupt:
print("\nStopped")