Improve TrytonException log level in worker
trytond logs TrytonExceptions as debug messages:
https://hg.tryton.org/trytond/file/tip/trytond/protocols/dispatcher.py#l198
There's a bit of a difference on how cron and worker treat them. Worker uses critical:
https://hg.tryton.org/trytond/file/tip/trytond/worker.py#l140
and cron error:
https://hg.tryton.org/trytond/file/tip/trytond/ir/cron.py#l173
Although probably this small inconsistency is probably an oversight, it works great most of the time because UserErrors or Warnings are not handled by the user in those situations so it must be managed by the sysadmin. So using ERROR or CRITICAL is a great way for the sysadmin to know what has to be fixed.
However, there's a problem when there's no worker and queue tasks are managed by the dispatcher():
https://hg.tryton.org/trytond/file/tip/trytond/protocols/dispatcher.py#l207
Because in this situation UserErrors do reach the user but are also signaled as CRITICAL in the logs. The latter is unnecessary.
I propose to expand run_task() to allow dispatcher indicate that the loglevel should be lowered to DEBUG, for consistency with what dispatcher itself does in line 198.