From c03443dd78de84f8914f518b26279c5f198f02e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D1=80=D0=B8=D0=B9=20=D0=A7=D0=B5=D1=80=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Sat, 1 Nov 2025 11:59:09 +0300 Subject: [PATCH] add /logs/* --- .gitignore | 3 ++- get_data.py | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 5626aff..a6931cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /__pycache__ -/TestJson \ No newline at end of file +/TestJson +/logs/* \ No newline at end of file diff --git a/get_data.py b/get_data.py index 8264c09..7fbca88 100644 --- a/get_data.py +++ b/get_data.py @@ -135,7 +135,7 @@ def start_offline_threads(season, game_id): t.start() CURRENT_THREADS_MODE = "offline" - print("[threads] OFFLINE threads started") + logger.info("[threads] OFFLINE threads started") def start_live_threads(season, game_id): @@ -232,7 +232,7 @@ def start_live_threads(season, game_id): t.start() CURRENT_THREADS_MODE = "live" - print("[threads] LIVE threads started") + logger.info("[threads] LIVE threads started") def stop_live_threads(): @@ -244,7 +244,7 @@ def stop_live_threads(): for t in threads_live: t.join(timeout=1) threads_live = [] - print("[threads] LIVE threads stopped") + logger.info("[threads] LIVE threads stopped") def stop_offline_threads(): @@ -256,7 +256,7 @@ def stop_offline_threads(): for t in threads_offline: t.join(timeout=1) threads_offline = [] - print("[threads] OFFLINE threads stopped") + logger.info("[threads] OFFLINE threads stopped") # общая очередь @@ -295,7 +295,7 @@ def get_data_from_API( value = {"error": str(ex)} ts = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] results_q.put({"source": name, "ts": ts, "data": value}) - print(f"[{ts}] name: {name}, status: {value.get('status', 'no-status')}") + logger.debug(f"[{ts}] name: {name}, status: {value.get('status', 'no-status')}") # сколько уже заняло elapsed = time.time() - start