← All recipes
Moderne licensed

Replace logger.warn() with logger.warning()

Recipe IDorg.openrewrite.python.cleanup.ReplaceLoggerWarnArtifactopenrewrite-migrate-python

Replace warn() calls on a logging.Logger or logging.LoggerAdapter with warning(). The warn() method is a deprecated alias that should not be used. It only fires where the receiver's type resolves, and leaves alone the module-level logging.warn() and a subclass that overrides warn().

Single recipepythoncleanupruffLOG009Proprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.python.cleanup.ReplaceLoggerWarn

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-migrate-python
mod config recipes jar install org.openrewrite.recipe:rewrite-migrate-python:RELEASE
mod config recipes jar install org.openrewrite:rewrite-python:RELEASE