.. versionchanged:: 3.8
The *stacklevel* parameter was added.
+ .. versionchanged:: 3.13
+ Remove the undocumented ``warn()`` method which was an alias to the
+ :meth:`warning` method.
+
.. method:: Logger.info(msg, *args, **kwargs)
Logs a message with level :const:`WARNING` on this logger. The arguments are
interpreted as for :meth:`debug`.
- .. note:: There is an obsolete method ``warn`` which is functionally
- identical to ``warning``. As ``warn`` is deprecated, please do not use
- it - use ``warning`` instead.
-
.. method:: Logger.error(msg, *args, **kwargs)
Logs a message with level :const:`ERROR` on this logger. The arguments are
use ``locale.setlocale(locale.LC_ALL, "")`` instead.
(Contributed by Victor Stinner in :gh:`104783`.)
+* Remove the undocumented and untested ``logging.Logger.warn()`` method,
+ deprecated since Python 3.3, which was an alias to the
+ :meth:`logging.Logger.warning` method: use the :meth:`logging.Logger.warning`
+ method instead.
+ (Contributed by Victor Stinner in :gh:`105376`.)
+
Porting to Python 3.13
======================
if self.isEnabledFor(WARNING):
self._log(WARNING, msg, args, **kwargs)
- def warn(self, msg, *args, **kwargs):
- warnings.warn("The 'warn' method is deprecated, "
- "use 'warning' instead", DeprecationWarning, 2)
- self.warning(msg, *args, **kwargs)
-
def error(self, msg, *args, **kwargs):
"""
Log 'msg % args' with severity 'ERROR'.
--- /dev/null
+Remove the undocumented and untested ``logging.Logger.warn()`` method,
+deprecated since Python 3.3, which was an alias to the
+:meth:`logging.Logger.warning` method: use the :meth:`logging.Logger.warning`
+method instead. Patch by Victor Stinner.