diff options
| author | UltraQbik <no1skill@yandex.ru> | 2024-08-20 18:58:07 +0300 |
|---|---|---|
| committer | UltraQbik <no1skill@yandex.ru> | 2024-08-20 18:58:07 +0300 |
| commit | eb4697d192c636fe9183dbc1caf1e1f693117141 (patch) | |
| tree | 94e8c97bbc95b6ee531abfc4bdb1d8a6812662ff /main.py | |
| parent | 2778b7de51e0c732e295c7ace4ce4a7e400d25b4 (diff) | |
| download | httpy-eb4697d192c636fe9183dbc1caf1e1f693117141.tar.gz httpy-eb4697d192c636fe9183dbc1caf1e1f693117141.zip | |
Add logging
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main.py b/main.py index 39ae8f3..4f82213 100644 --- a/main.py +++ b/main.py @@ -142,6 +142,10 @@ class HTTPServer: # decode request request: Request = Request.create(raw_request) + # log request + async with aiofiles.open("logs.log", "a") as f: + await f.write(f"IP: {client.getpeername()[0]}\n{request}\n\n") + # handle requests try: match request.type: |