Add the possibility to dynamically change the logger level of Odoo and
per IoT handler (drivers and interfaces).
This will be done through the "Handler List" page.
This will be useful to troubleshoot purposes.
In particular when it happens on a specific handler.
The level set should persist on shutdown as saved in Odoo's configuration
using the `--log-handler` parameter, see:
https://www.odoo.com/documentation/16.0/developer/reference/cli.html#cmdoption-odoo-bin-log-handler
Notes:
- When changing Odoo's level, `werkzeug` logger will change to the same
level automatically (except in `debug` on which `werkzeug` will be set
to `info`)
- `--log-level` Odoo config wasn't used as it has unintended side
effects when dynamically switching to this level
- `load_iot_handlers` was modified as otherwise the loggers `__name__`
could be wrong and inconsistent on which several logger for a handler
exists. For example: `PrinterInterface.py` and
`odoo.addons.hw_drivers.iot_handlers.interfaces.PrinterInterface`. In
this situation `_logger` can be different from one used in the class.
In addition, of that, the parent logger for the different loggers could
be different (root and Odoo generally)
opw-3493585
closesodoo/odoo#139970
X-original-commit: 931456fed24c0d7700defd7672157d8bc54c3fe5
Signed-off-by: Loan Sens (lse) <lse@odoo.com>