Open JBrummans opened 3 years ago
The bot should log every command someone runs for troubleshooting and monitoring purposes.
EG using pythons build in logging function should work:
import logging logging.basicConfig(filename=os.getenv("LOG_FILE"), level=logging.INFO, filemode='a', format='%(asctime)s - %(levelname)s - %(message)s') @bot.before_invoke async def command_logger(ctx): server = ctx.guild.name logging.info(str(server) + ":" + str(ctx.author) + " ran the command "+ bot.command_prefix + str(ctx.command))
The bot should log every command someone runs for troubleshooting and monitoring purposes.
EG using pythons build in logging function should work: