Add full log config. Fixes #166

This commit is contained in:
Tulir Asokan
2018-07-12 22:47:40 +03:00
parent 2172587286
commit 042d89cf65
6 changed files with 52 additions and 23 deletions
+8 -2
View File
@@ -154,8 +154,6 @@ class Config(DictWithRecursion):
copy("appservice.public.prefix")
copy("appservice.public.external")
copy("appservice.debug")
copy("appservice.id")
copy("appservice.bot_username")
copy("appservice.bot_displayname")
@@ -218,6 +216,14 @@ class Config(DictWithRecursion):
copy("telegram.api_hash")
copy("telegram.bot_token")
if "appservice.debug" in self and "logging" not in self:
level = "DEBUG" if self["appservice.debug"] else "INFO"
base["logging.root.level"] = level
base["logging.loggers.mau.level"] = level
base["logging.loggers.telethon.level"] = level
else:
copy("logging")
self._data = base._data
self.save()