Browse Source

Less verbose logs

Logs are cluttered by 'initial value...updated value' and it is really not
necessary to log that using a 'info' level.
The 'error' log level is excessive for the missing country.

If someone really wants to display the original and updated values, there still
is the possibility to use a ``--log-handler=openerp.addons.base_phone:DEBUG``.
pull/83/head
Guewen Baconnier 9 years ago
committed by Sebastien LANGE
parent
commit
f2d8a9868b
  1. 4
      base_phone/base_phone.py

4
base_phone/base_phone.py

@ -77,7 +77,7 @@ class PhoneCommon(models.AbstractModel):
if user.company_id.country_id: if user.company_id.country_id:
countrycode = user.company_id.country_id.code countrycode = user.company_id.country_id.code
else: else:
_logger.error(
_logger.warning(
_("You should set a country on the company '%s' " _("You should set a country on the company '%s' "
"to allow the reformat of phone numbers") "to allow the reformat of phone numbers")
% user.company_id.name) % user.company_id.name)
@ -94,7 +94,7 @@ class PhoneCommon(models.AbstractModel):
vals[field] = phonenumbers.format_number( vals[field] = phonenumbers.format_number(
res_parse, phonenumbers.PhoneNumberFormat.E164) res_parse, phonenumbers.PhoneNumberFormat.E164)
if init_value != vals[field]: if init_value != vals[field]:
_logger.info(
_logger.debug(
"%s initial value: '%s' updated value: '%s'" "%s initial value: '%s' updated value: '%s'"
% (field, init_value, vals[field])) % (field, init_value, vals[field]))
except Exception, e: except Exception, e:

Loading…
Cancel
Save