ne 3. 6. 2018 v 22:35 odesílatel Bináris <wikiposta@gmail.com> napsal:
2018-06-03 22:23 GMT+02:00 Martin Urbanec <martin.urbanec@wikimedia.cz>:

Well, failed sliently?  Again, I run the same bot in cs.wiki and this is what I can see in logs. 
Yes, that's what I wrote in the initial letter with a link to the log. For me, this is quite silent.

If somebody writes "fail sliently", I expect "without any notice" automatically. There is a notice, but the notice isn't processed by the operator or their bots. 

But your example shows something important: Dalba's solution is not general enough, either. It will work for abusefilter-warning, but not for SpamFilterError. Or for abuse filters that deny edit. 

You cannot save an edit that is being denied. This is what such filters are used to, to prevent some edits. Still, not a framework problem IMHO.  
 

Of course Pywikibot didn't report it by email, because it will be unexpectable (and, to be precise, Pywikibot do not always have a way to email you - for example, my Pywikibot bot password don't allow emailing (well, maybe it does, I'm not sure, but it isn't required to allow it). 

Pywikibot should have the option to send a mail to the owner, if he/she wants, and setting the e-mail option for the bot account is worth for this purpose.
Of course, it wouldn't be obligatory.

Really? Imagine we have this feature and imagine a bot operator that says "Hey, you can notify the bot operator via email, let's implement SMS as well". Then, other bot operators can require a lot of different notification types. This will make Pywikibot unsustainable. Instead, let's follow a good Unix rule. One program should focus on only one thing. If I'm writing a framework that is interacting with MW API (purpose of Pywikibot), it should interact with MW API and not monitor logs. If I want to monitor logs, I should use another program (generally called log watcher) that focuses on watching/monitoring logs and reporting some patterns to the admin.

I store all logs from my Pywikibot scripts in ~/logs. If I want, I can create a maintenance job to monitor the logs. It will generally execute something like this. It would be relatively easy to modify this to monitor other bots (multiple maintenance jobs, or one running in multiple threads) and/or include the traceback directly in the mail. 

tail -Fn0 /data/project/urbanecmbot/logs/archivePages.log | \
while read line ; do
        echo "$line" | grep -q "ERROR"
        if [ $? = 0 ]
        then
                echo "Fatal error in ArchiveBot, see /data/project/urbanecmbot/logs/archivePages.log for details" | /usr/bin/mail -s "Error notification" martin.urbanec@wikimedia.cz
        fi
done 
 
I don't think we could expect bot owners to monitor their logs all the time. Why should a human do the work of a computer?

I didn't say a human should do it. I said that the bot operator is expected to monitor the logs, either themselfes or using a bot. It is the same for system administrator. The services running in the system log various events into log service, but this is the only thing it does. The log service store the events in logfiles (default setting) or to dedicated log server. If the sysadmin want to know about some events by email/SMS/whatever, they should employ a service that is supposed to monitor for given patterns in given log files. 

_______________________________________________
pywikibot mailing list
pywikibot@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot