MOTIVATION:
When testing, logging to the console is perfect. However, in a working setup, it's worth very little.
In the past, there have been problems with logging into a file on the Raspberry Pi (our preferred platform) because of persistence. Hence, I've introduced the new debugging modes "Group" and "Private" that send messages to specific groups or users containing the logs whenever an error occurs.
NEW OPTIONS FOR /src/main.py:
-d <mode>: logging enabled, mode can be nothing or one of (group, private, file)
-d file -f <path>: log into specified file
OVERVIEW:
If no mode is specified, the logging level is set to DEBUG and streamed to the console.
If mode "file" is specified, the logging level is set to ERROR and streamed to either tg_bot_log.txt or the file specified with -f.
If mode "private" ("group") is specified, the logging level is set to ERROR and all errors from the dispatcher logger (i.e. everything relevant to our code) are sent to a user (group). The bot asks every new user (group) that authenticates whether they would like to receive debug messages until exactly one user (group) answers in the affirmative. From then on, they get sent all error messages.
This branch introduces a debug mode.
CHANGES:
python3 /src/main.py
does not log any debug messages anymore.MOTIVATION: When testing, logging to the console is perfect. However, in a working setup, it's worth very little. In the past, there have been problems with logging into a file on the Raspberry Pi (our preferred platform) because of persistence. Hence, I've introduced the new debugging modes "Group" and "Private" that send messages to specific groups or users containing the logs whenever an error occurs.
NEW OPTIONS FOR
/src/main.py
:OVERVIEW:
-f
.