Deprecate --disable-log-requests and replace with --enable-log-requests (#21739)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-08-01 17:16:37 +01:00
committed by GitHub
parent 97608dc276
commit 2d7b09b998
18 changed files with 97 additions and 79 deletions

View File

@@ -1668,6 +1668,12 @@ class FlexibleArgumentParser(ArgumentParser):
# Enable the deprecated kwarg for Python 3.12 and below
def parse_known_args(self, args=None, namespace=None):
if args is not None and "--disable-log-requests" in args:
# Special case warning because the warning below won't trigger
# if -disable-log-requests because its value is default.
logger.warning_once(
"argument '--disable-log-requests' is deprecated. This "
"will be removed in v0.12.0.")
namespace, args = super().parse_known_args(args, namespace)
for action in FlexibleArgumentParser._deprecated:
if (hasattr(namespace, dest := action.dest)