flake8-logging
A Flake8 plugin that checks for issues using the standard library logging module.
Decision gist · record as of 2026-08-14
Yes. This is a focused, well-maintained Flake8 plugin with no dependencies beyond Flake8 itself, zero known vulnerabilities, and clear value for teams using Python's standard logging module. The rules target real bugs that can silently break logging in production. Install it if you use Flake8 and want to prevent common logging mistakes.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later and an existing Flake8 installation.
- Low friction: pure Python wheel with only flake8 as a runtime dependency.
- Actively maintained with recent releases and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.
last release 2025-09-08 (340 days) · last repo commit 2026-08-13 · 86 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 96,608 downloads/mo, #13,204 on PyPI
Alternatives
Verify before relying
pip install flake8-logging
Then run flake8 on your code:
flake8 your_module.py
If you use Flake8's select setting, add 'L' to it.- Whether the plugin auto-activates in all Flake8 configurations or only when explicitly selected.
- Performance impact when running against large codebases with many logging statements.
What it is and what it does
flake8-logging is a Flake8 plugin that enforces logging best practices from Python's standard library documentation. It detects eight categories of logging mistakes: direct Logger instantiation instead of getLogger(), using __file__ or __cached__ instead of __name__ with getLogger(), LogRecord attribute name clashes in the extra dict, calling exception() outside exception handlers, calling error() instead of exception() within handlers, redundant exc_info arguments, using exception() with exc_info=False, and deprecated warn() calls.
The plugin integrates directly into your Flake8 workflow and flags violations with specific rule codes (LOG001 through LOG008). It's designed for teams that want to catch logging configuration and usage errors before they reach production, where misconfigured loggers can silently fail to report errors or send messages only to stderr.
Use it for
- Catch direct Logger() instantiation that bypasses the logger tree and configuration.
- Enforce consistent logger naming with __name__ to ensure proper hierarchical organization.
- Prevent runtime KeyError crashes from LogRecord attribute name collisions in extra dicts.
- Ensure exception() is only called within exception handlers where it captures context automatically.
- Enforce clearer logging patterns by flagging redundant or contradictory exc_info arguments.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a focused, well-maintained Flake8 plugin with no dependencies beyond Flake8 itself, zero known vulnerabilities, and clear value for teams using Python's standard logging module. The rules target real bugs that can silently break logging in production. Install it if you use Flake8 and want to prevent common logging mistakes.
Install
flake8-logging on PyPI
Before you install
Low friction: pure Python wheel with only flake8 as a runtime dependency. Actively maintained with recent releases and no known vulnerabilities.
Requires Python 3.9 or later and an existing Flake8 installation.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.
Quickstart
pip install flake8-logging
Then run flake8 on your code:
flake8 your_module.py
If you use Flake8's select setting, add 'L' to it.
Verify before relying
- Whether the plugin auto-activates in all Flake8 configurations or only when explicitly selected.
- Performance impact when running against large codebases with many logging statements.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageflake8 |
| Maintenance | Actively maintained 340 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 96,608 / month, #13,204 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: Flake8Intended Audience :: DevelopersNatural Language :: EnglishProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Typing :: Typed |
Evidence: flake8_logging-1.8.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “flake8 logging plugin”
- flake8-loggingA Flake8 plugin that detects and flags common mistakes in Python's…
- flake8-logging-formatA flake8 extension that enforces logging best practices by detecting…
- flake8-helperProvides utility functions and base classes to simplify building…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also flake8-helper · flake8-logging-format · flake8-use-pathlib · flake8-django · flake8-mutable · flake8-executable · flake8-unused-arguments · python-simple-logger · vmodule · flake8-variables-names