python-mattermost-driver
python-mattermost-driver copied to clipboard
errors are unconditionally logged to terminal
While writing some code against our Mattermost, I discovered that exceptions are being logged, even though my code is handling them. For example, ResourceNotFound
wrote the following to my terminal:
Unable to find an existing account matching your username for this team. This team may require an invite from the team owner to join.
My script dealt with the situation, and so this logging is unwanted noise.
Mhh, I get your point. What do you think would be a good solution for that? Would you be okay if you had an option like, dont log errors or rather a log anything at all?
I think, keeping the log.error
active by default helps people to spot problems faster, so I would prefer an option to disable the output.
One option, as a user of mattermostdriver
, is to disable the logger by setting
logging.getLogger('mattermostdriver.websocket').disabled = True
On a related note, it would be good to have a common ancestor for all exceptions thrown.