This commit is contained in:
2026-04-08 18:14:11 +09:00
parent c4968a6b78
commit 8caa642dda
7 changed files with 41 additions and 16 deletions
+1
View File
@@ -7,6 +7,7 @@ from datetime import datetime, timezone
access_log_path = Path.cwd().joinpath("logs", "access.log")
access_log_path.parent.mkdir(parents=True, exist_ok=True)
# TODO: ステータスコードとかも含めたい でもそれにはレスポンスが出来上がってからログを書く必要があるので/echoとかを残すには工夫がいりそう
def log_access(scope: Scope, write: bool = True):
client = scope.get("client") or ("", 0)
server = scope.get("server") or ("", 0)