8000 Introduce generic logger type in loggeradapter by hoefling · Pull Request #5954 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Introduce generic logger type in loggeradapter #5954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 25, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
introduce generic logger type in loggingadapter
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
  • Loading branch information
hoefling committed Aug 24, 2021
commit 1e7e2c9788c0203d66b959fa573ec824afded9e6
10 changes: 6 additions & 4 deletions stdlib/logging/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -315,15 +315,17 @@ class LogRecord:
) -> None: ...
def getMessage(self) -> str: ...

class LoggerAdapter:
logger: Logger | LoggerAdapter
_L = TypeVar("_L", Logger, LoggerAdapter)

class LoggerAdapter(Generic[_L]):
logger: _L
manager: Manager # undocumented
if sys.version_info >= (3, 10):
extra: Mapping[str, Any] | None
def __init__(self, logger: Logger | LoggerAdapter, extra: Mapping[str, Any] | None) -> None: ...
def __init__(self, logger: _L, extra: Mapping[str, Any] | None) -> None: ...
else:
extra: Mapping[str, Any]
def __init__(self, logger: Logger | LoggerAdapter, extra: Mapping[str, Any]) -> None: ...
def __init__(self, logger: _L, extra: Mapping[str, Any]) -> None: ...
def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> tuple[Any, MutableMapping[str, Any]]: ...
if sys.version_info >= (3, 8):
def debug(
Expand Down
0