Skip to content
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

Rework stdlib compat #470

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
reformatting post tox run
  • Loading branch information
segfault committed Nov 14, 2022
commit 64ce3ecc5ec066f273152d9d6f96d854dacc4dde
1 change: 0 additions & 1 deletion src/structlog/_boundlogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,3 @@ def getChild(self, suffix: str) -> logging.Logger:
Calls :meth:`logging.Logger.getChild` with unmodified arguments.
"""
return self._logger.getChild(suffix)

14 changes: 10 additions & 4 deletions src/structlog/_level_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@
from typing import Any, Callable

from ._boundlogger import BoundLogger
from ._log_levels import _LEVEL_TO_NAME, CRITICAL, FATAL, ERROR, WARNING, INFO, DEBUG, NOTSET
from ._log_levels import (
_LEVEL_TO_NAME,
CRITICAL,
DEBUG,
ERROR,
FATAL,
INFO,
NOTSET,
WARNING,
)
from .typing import FilteringBoundLogger


Expand Down Expand Up @@ -43,8 +52,6 @@ async def aexception(self: FilteringBoundLogger, event: str, **kw: Any) -> Any:
)




def _make_filtering_bound_logger(min_level: int) -> type[FilteringBoundLogger]:
"""
Create a new `FilteringBoundLogger` that only logs *min_level* or higher.
Expand Down Expand Up @@ -178,4 +185,3 @@ def make_filtering_bound_logger(min_level: int) -> type[FilteringBoundLogger]:
DEBUG: BoundLoggerFilteringAtDebug,
NOTSET: BoundLoggerFilteringAtNotset,
}

2 changes: 0 additions & 2 deletions src/structlog/_log_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,3 @@ def add_log_level(
event_dict["level"] = method_name

return event_dict


2 changes: 1 addition & 1 deletion src/structlog/stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

from . import _config
from ._base import BoundLoggerBase
from ._boundlogger import BoundLogger
from ._frames import _find_first_app_frame_and_name, _format_stack
from ._log_levels import _LEVEL_TO_NAME, _NAME_TO_LEVEL, add_log_level
from ._boundlogger import BoundLogger
from .contextvars import merge_contextvars
from .exceptions import DropEvent
from .processors import StackInfoRenderer
Expand Down