From 5b9a1414a2858181970423bd81b0afc2b6057a6e Mon Sep 17 00:00:00 2001 From: Aryan Singh Date: Sun, 27 Sep 2026 23:03:17 -0500 Subject: [PATCH] more logging lol MP1 init --- MP2/peer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MP2/peer.py b/MP2/peer.py index 99d6b8b..ee73d52 100644 --- a/MP2/peer.py +++ b/MP2/peer.py @@ -15,13 +15,19 @@ def _machine_index(): return None log_file = open(f"machine.{_machine_index()}.log", "w") +log_file_mp1 = open(f"/home/asing271/fa26_cs425_.group-mp_.team-01/MP1/machine.{_machine_index()}.log","w") + log_lock = threading.Lock() def log(message): timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3] with log_lock: + print(f"[{timestamp}] {message}") log_file.write(f"[{timestamp}] {message}\n") log_file.flush() + log_file_mp1.write(f"[{timestamp}] {message}\n") + log_file_mp1.flush() + def utc_time(): return datetime.now(timezone.utc).timestamp()