[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-05-04 23:11:03 +00:00
parent 3f50e11065
commit cb9b2d9e9f

View File

@ -1,5 +1,6 @@
import datetime import datetime
class AccessLogGenerator: class AccessLogGenerator:
""" """
Object that implements the Daphne "action logger" internal interface in Object that implements the Daphne "action logger" internal interface in
@ -29,10 +30,14 @@ class AccessLogGenerator:
request=message, 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 Writes an NCSA-style entry to the log file (some liberty is taken with
what the entries are for non-HTTP) what the entries are for non-HTTP)
""" """
formatted_date = date.strftime("%d/%b/%Y:%H:%M:%S") 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'
)