Skip to content

~25 classes duplicate self.logger = logging.getLogger(...) instead of a shared helper #154

Description

@Rushaway

Part of #147

Finding

self.logger = logging.getLogger(self.__class__.__name__) is copy-pasted into the __init__ of 25+ classes (e.g. Config.py:14, Player.py:15, Commands.py:50, CommandHandler.py:25, ClientProtocol.py:12, AsyncClient.py:20, SourceRCONClient.py:22, PlayerManager.py:20, and many more).

Why it matters

Purely mechanical duplication with no functional issue today, but any future change to the logger-naming convention (e.g. adding a module prefix) requires touching every one of these files individually.

Suggested fix

A small LoggerMixin (or a module-level get_logger(obj) helper) would remove ~25 identical lines and centralize the convention.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions