matobodo/DiscordWebhookLogging

does not support the %s string format notation

Opened this issue · 2 comments

3ear commented

try to logger.info("%s" % "my strong") will not display correctly. Instead it will display "+ | %s"

I don't see any reason why this shouldn't work, because the formatting string is evaluated before it is passed to the info function.

For me it was working as expected

import logging
from discord_webhook_logging import DiscordWebhookHandler


logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
handler = DiscordWebhookHandler(webhook_url='https://discord.com/api/webhooks/...', auto_flush=True)
logger.addHandler(handler)

logger.info("%s" % "my string")

image

3ear commented

Interesting

image

I will provide an minimal reproduciable sample later but the environment is a discord bot running with asyncio, inside a docker container with python 3.10.12