Make debug loggin configurable

This commit is contained in:
Gabriel Huber 2025-05-15 15:02:47 +02:00
parent 6c427ccd98
commit 6dab8b6b68
2 changed files with 3 additions and 1 deletions

1
README.txt Normal file
View file

@ -0,0 +1 @@
Dependencies: python3-aiohttp python3-slixmpp

View file

@ -6,7 +6,6 @@ import asyncio
import logging
import configparser
logging.basicConfig(level=logging.DEBUG)
url_regex = re.compile(r"https?://[^\s#]+")
class PreviewBot(slixmpp.ClientXMPP):
@ -56,6 +55,8 @@ class PreviewBot(slixmpp.ClientXMPP):
if __name__ == "__main__":
config = configparser.ConfigParser()
config.read_file(open("bot.ini"))
if "Logging" in config:
logging.basicConfig(level=int(config["Logging"]["loglevel"]))
bot = PreviewBot(
config["Login"]["jid"],
config["Login"]["password"],