Ikabot-Collective / ikabot

A Python-based bot designed for automating tasks in the game Ikariam
https://discord.com/invite/3hyxPRj
MIT License
102 stars 67 forks source link

Add debug options into .ikabot file #240

Open susikaman opened 7 months ago

susikaman commented 7 months ago

Is your feature request related to a problem? Please describe. Right now, the config.py needs to be edited by hand in order to enable debug options for functions. This requires restarting of Ikabot and possibly rebuilding of it, which is a hassle just to have a couple debug messages sent to the TG.

Describe the solution you'd like Add debug options into the .ikabot file instead of having them hardcoded into the config file. The config.py options would stay as default options in case there is no entry in the .ikabot file.

Describe alternatives you've considered I have tried adding separate controllers into the .ikabot file which would change the config.py options accordingly, but it seems that the config.py cannot be modified on the fly like that.

ikagod commented 7 months ago

I actually think we should completely nuke all the debugging by telegram options that we have in ikabot and instead add session.WriteLog calls with DEBUG level criticality where we want to log a debug message. The log level by default is WARN, so they will not be logged by default, but if the user wishes to, they can turn it down to DEBUG and get all the information they need.

The downside to this is that the logs aren't sent automatically over Telegram, although I believe it could be useful to make ikabot's logging module automatically send the debug messages over telegram instead of having them be send "manually" by invoking sendToBot() function calls.

Thanks for remining me about this.