Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LOG_LEVEL never gets set and blocks bot from initiating #554

Open
morronitech opened this issue Nov 29, 2024 · 0 comments
Open

LOG_LEVEL never gets set and blocks bot from initiating #554

morronitech opened this issue Nov 29, 2024 · 0 comments

Comments

@morronitech
Copy link

morronitech commented Nov 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant