globality-corp / flake8-logging-format

Flake8 extension to validate (lack of) logging format strings
Apache License 2.0
134 stars 21 forks source link

Should check `.log(level, msg)` calls too #69

Open andersk opened 1 year ago

andersk commented 1 year ago
import logging
logger = logging.getLogger("test")
a, b = "a", "b"
logger.error(f"{a} {b}")  # raises G004 Logging statement uses f-string
logger.log(logging.ERROR, f"{a} {b}")  # should raise G004, but doesn’t