diff options
| author | Xavier-Do <xdo@odoo.com> | 2020-03-04 11:00:38 +0000 |
|---|---|---|
| committer | Xavier-Do <xdo@odoo.com> | 2020-03-16 13:21:57 +0000 |
| commit | b2b36524c27ddd8a892fe740a5eec874e06f8cf8 (patch) | |
| tree | bfe74f8bd4a855954a617cca673ffb8cc33cbb96 /addons/l10n_ar | |
| parent | a12479aaa8cb2c8311c8d6c0fceb0dc641b44eac (diff) | |
[IMP] core: improve module loading logs
Performances from a general point of view can be difficult to track.
This commit proposes to improve logs in two ways:
The current logs only use the sql_counter, wich will only be updated
when a cursor is closed. In a test-enable install, this counter
is actually the queries of the tests wince the install cursor is
open untill the end. The first fix is to use bot sql_counter and
sql_log_count to have total queries untill now on closed cursor,
but also the current number of queries of the current cursor.
This means that the new log format will be
{nb} modules loaded in {time}, {loading_querie} (+{test_cr_queries}) queries
instead of
{nb} modules loaded in {time}, {tests_cr__queries}queries
Nothe that in the current version, {nb} is actually the total number of
loaded modules until now.
This commit also add an equivalent end log by module and change the
loglevel of module start on install (mainly usefull if an error occurs
before anything else is logged hidding the module causing this error.)
A cleaner runbot logger is also added, in order to be abble to call
_logger.runbot( instead of _logger.log(25. This will clarify the purpose
of such a log level.
closes odoo/odoo#47283
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Diffstat (limited to 'addons/l10n_ar')
| -rw-r--r-- | addons/l10n_ar/models/res_partner.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/l10n_ar/models/res_partner.py b/addons/l10n_ar/models/res_partner.py index d79552f3583..dd4d7aee514 100644 --- a/addons/l10n_ar/models/res_partner.py +++ b/addons/l10n_ar/models/res_partner.py @@ -41,7 +41,7 @@ class ResPartner(models.Model): rec.l10n_ar_formatted_vat = stdnum.ar.cuit.format(rec.l10n_ar_vat) except Exception as error: rec.l10n_ar_formatted_vat = rec.l10n_ar_vat - _logger.log(25, "Argentinian VAT was not formatted: %s", repr(error)) + _logger.runbot("Argentinian VAT was not formatted: %s", repr(error)) remaining = self - recs_ar_vat remaining.l10n_ar_formatted_vat = False @@ -96,7 +96,7 @@ class ResPartner(models.Model): module = rec._get_validation_module() except Exception as error: module = False - _logger.log(25, "Argentinian document was not validated: %s", repr(error)) + _logger.runbot("Argentinian document was not validated: %s", repr(error)) if not module: continue |
