From: Hynek Schlawack <hs@ox.cx>
Date: Tue, 27 May 2025 17:04:32 +0200
Subject: Add 3.14

Origin: upstream, https://github.com/hynek/structlog/pull/723
---
 pyproject.toml          | 1 +
 src/structlog/stdlib.py | 7 ++++++-
 tox.ini                 | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 69dc5d9..456f757 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -23,6 +23,7 @@ classifiers = [
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
     "Programming Language :: Python :: 3.13",
+    "Programming Language :: Python :: 3.14",
     "Topic :: System :: Logging",
     "Typing :: Typed",
 ]
diff --git a/src/structlog/stdlib.py b/src/structlog/stdlib.py
index 80ee628..2c49b78 100644
--- a/src/structlog/stdlib.py
+++ b/src/structlog/stdlib.py
@@ -787,7 +787,12 @@ def filter_by_level(
     ...
     DropEvent
     """
-    if logger.isEnabledFor(NAME_TO_LEVEL[method_name]):
+    if (
+        # We can't use logger.isEnabledFor() because it's always disabled when
+        # a log entry is in flight on Python 3.14 and later,
+        not logger.disabled
+        and NAME_TO_LEVEL[method_name] >= logger.getEffectiveLevel()
+    ):
         return event_dict
 
     raise DropEvent
diff --git a/tox.ini b/tox.ini
index 4873754..3fdc388 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,7 +3,7 @@ min_version = 4
 env_list =
     pre-commit,
     mypy-pkg,
-    py3{8,9,10,11,12,13}-{tests,mypy}
+    py3{8,9,10,11,12,13,14}-{tests,mypy}
     py3{8,13}-tests-{colorama,be,rich},
     docs-{sponsors,doctests},
     coverage-report
