mirror of
https://github.com/vee1e/bulk-questionnaire-upload.git
synced 2026-09-01 17:57:10 +00:00
10 lines
293 B
Python
10 lines
293 B
Python
import time
|
|
import os
|
|
|
|
METRICS_FILE = os.path.join(os.path.dirname(__file__), "metrics.txt")
|
|
|
|
|
|
def log_metric(metric_name: str, value) -> None:
|
|
timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
|
|
with open(METRICS_FILE, "a") as f:
|
|
f.write(f"[{timestamp}] {metric_name}: {value}\n")
|