mirror of
https://github.com/django/daphne.git
synced 2024-11-24 08:53:43 +03:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
3f50e11065
commit
cb9b2d9e9f
|
@ -1,5 +1,6 @@
|
|||
import datetime
|
||||
|
||||
|
||||
class AccessLogGenerator:
|
||||
"""
|
||||
Object that implements the Daphne "action logger" internal interface in
|
||||
|
@ -29,10 +30,14 @@ class AccessLogGenerator:
|
|||
request=message,
|
||||
)
|
||||
|
||||
def write_entry(self, host, date, request, status="-", length="-", ident="-", user="-"):
|
||||
def write_entry(
|
||||
self, host, date, request, status="-", length="-", ident="-", user="-"
|
||||
):
|
||||
"""
|
||||
Writes an NCSA-style entry to the log file (some liberty is taken with
|
||||
what the entries are for non-HTTP)
|
||||
"""
|
||||
formatted_date = date.strftime("%d/%b/%Y:%H:%M:%S")
|
||||
self.stream.write(f"{host} {ident} {user} [{formatted_date}] \"{request}\" {status} {length}\n")
|
||||
self.stream.write(
|
||||
f'{host} {ident} {user} [{formatted_date}] "{request}" {status} {length}\n'
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user