1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

Проверка 09.02.2025

This commit is contained in:
MoonTestUse1
2025-02-09 01:11:49 +06:00
parent ce52f8a23a
commit 0aa3ef8fc2
5827 changed files with 14316 additions and 1906434 deletions

View File

@@ -16,7 +16,7 @@ class ColourizedFormatter(logging.Formatter):
A custom log formatter class that:
* Outputs the LOG_LEVEL with an appropriate color.
* If a log call includes an `extras={"color_message": ...}` it will be used
* If a log call includes an `extra={"color_message": ...}` it will be used
for formatting the output, instead of the plain text message.
"""
@@ -26,9 +26,7 @@ class ColourizedFormatter(logging.Formatter):
logging.INFO: lambda level_name: click.style(str(level_name), fg="green"),
logging.WARNING: lambda level_name: click.style(str(level_name), fg="yellow"),
logging.ERROR: lambda level_name: click.style(str(level_name), fg="red"),
logging.CRITICAL: lambda level_name: click.style(
str(level_name), fg="bright_red"
),
logging.CRITICAL: lambda level_name: click.style(str(level_name), fg="bright_red"),
}
def __init__(
@@ -86,7 +84,7 @@ class AccessFormatter(ColourizedFormatter):
status_phrase = http.HTTPStatus(status_code).phrase
except ValueError:
status_phrase = ""
status_and_phrase = "%s %s" % (status_code, status_phrase)
status_and_phrase = f"{status_code} {status_phrase}"
if self.use_colors:
def default(code: int) -> str:
@@ -106,7 +104,7 @@ class AccessFormatter(ColourizedFormatter):
status_code,
) = recordcopy.args # type: ignore[misc]
status_code = self.get_status_code(int(status_code)) # type: ignore[arg-type]
request_line = "%s %s HTTP/%s" % (method, full_path, http_version)
request_line = f"{method} {full_path} HTTP/{http_version}"
if self.use_colors:
request_line = click.style(request_line, bold=True)
recordcopy.__dict__.update(