Добавлен runtime logs engine

Этот коммит содержится в:
Виктор
2026-05-11 23:35:36 +09:00
родитель 7853272420
Коммит 7afc8d3637
+17
Просмотреть файл
@@ -0,0 +1,17 @@
from datetime import datetime
from collections import deque
MAX_LOGS = 500
runtime_logs = deque(maxlen=MAX_LOGS)
def add_log(message: str):
runtime_logs.appendleft({
'timestamp': datetime.utcnow().isoformat(),
'message': message,
})
def get_logs(limit: int = 100):
return list(runtime_logs)[:limit]