Skip to content

LOG_LEVEL never gets set and blocks bot from initiating #554

Description

Describe the bug
I cannot set the LOG_LEVEL setting and mmpy_bot will not initiate. I have tried 2.2.0 and the latest master branch.

How To Reproduce
This is the code I used to create the bot

def run_mattermost_bot(app, plugins):
    """Initialize and run the Mattermost bot with specified plugins."""
    bot = Bot(
        settings=Settings(
            MATTERMOST_URL=app.config.get("MATTERMOST_API_URL"),
            MATTERMOST_PORT=443,
            BOT_TOKEN=app.config.get("MATTERMOST_BOT_TOKEN"),
            BOT_TEAM=app.config.get("MATTERMOST_TEAM"),
            SSL_VERIFY=True,
            LOG_LEVEL=logging.INFO,
        ),
        plugins=plugins,
    )
  bot.run()

If I want to workaround this, I can add the following check inside mmpy_bot/settings.py (line ~ 124)

        elif f.type in [int, float, str]:  # type: ignore
            if f.name == "LOG_LEVEL":
                value = logging.getLevelName(value)
            value = f.type(value)

Expected behavior
I expect the bot to boot up/initiate

Operating Environment (please complete the following information):

  • 2.2.0
  • mattermostdriver/mattermostautodriver Version: 1.3.0
  • Mattermost Server Version: 9.11.1
  • Python Version: 3.13
  • OS: Linux

Additional context
This is a flask app.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions