Skip to content

Wrong logger name in plugins module #1779

@szapp

Description

@szapp

Describe the bug
The logger of the plugins module is named "__name__" instead of __name__ resulting in log messages that are not traceable to their source.

Expected behavior
The typo (presumably) is corrected and the log messages show alembic.runtime.plugins instead of __name__.

To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example, with the migration script and/or the SQLAlchemy tables or models involved.
See also Reporting Bugs on the website.

import logging

from alembic.runtime.plugins import Plugin

logging.basicConfig(level="INFO")

Plugin("hello world")

Error

INFO:__name__:setup plugin hello world

Versions.

  • OS: macOS 26.2
  • Python: 3.14.2
  • Alembic: 1.18.0
  • SQLAlchemy: 2.0.45
  • Database: -
  • DBAPI: -

Additional context

Should be an easy fix:

log = logging.getLogger("__name__")

-log = logging.getLogger("__name__")
+log = logging.getLogger(__name__)

Have a nice day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions