cddb07a176
build container image / cpu (push) Waiting to run
build container image / cuda (push) Waiting to run
build container image / rocm (push) Waiting to run
frontend tests / frontend-tests (push) Waiting to run
openapi checks / openapi-checks (push) Waiting to run
python tests / py3.12: macos-default (push) Waiting to run
python tests / py3.11: windows-cpu (push) Waiting to run
python tests / py3.12: windows-cpu (push) Waiting to run
python tests / py3.11: linux-cpu (push) Waiting to run
python tests / py3.12: linux-cpu (push) Waiting to run
typegen checks / typegen-checks (push) Waiting to run
uv lock checks / uv-lock-checks (push) Waiting to run
frontend checks / frontend-checks (push) Waiting to run
lfs checks / lfs-check (push) Waiting to run
python checks / python-checks (push) Waiting to run
python tests / py3.11: macos-default (push) Waiting to run
docs / deploy (push) Has been cancelled
docs / changes (push) Has been cancelled
docs / check-and-build (push) Has been cancelled
13 lines
504 B
Python
13 lines
504 B
Python
import logging
|
|
from typing import Any, MutableMapping
|
|
|
|
|
|
# Issue with type hints related to LoggerAdapter: https://github.com/python/typeshed/issues/7855
|
|
class PrefixedLoggerAdapter(logging.LoggerAdapter): # type: ignore
|
|
def __init__(self, logger: logging.Logger, prefix: str):
|
|
super().__init__(logger, {})
|
|
self.prefix = prefix
|
|
|
|
def process(self, msg: str, kwargs: MutableMapping[str, Any]) -> tuple[str, MutableMapping[str, Any]]:
|
|
return f"[{self.prefix}] {msg}", kwargs
|