[MERGE] trunk-logging-vmt (use module logging instead of netsvc.Logger)

bzr revid: rco@openerp.com-20121025130930-uek0a89xaxlr3tfo
This commit is contained in:
Raphael Collet 2012-10-25 15:09:30 +02:00
commit a54c32ced4
4 changed files with 7 additions and 6 deletions

View File

@ -19,11 +19,14 @@
#
##############################################################################
import logging
import time
from osv import osv, fields
import netsvc
_logger = logging.getLogger(__name__)
class payment_mode(osv.osv):
_name= 'payment.mode'
_description= 'Payment Mode'
@ -70,9 +73,7 @@ class payment_order(osv.osv):
#dead code
def get_wizard(self, type):
logger = netsvc.Logger()
logger.notifyChannel("Warning!", netsvc.LOG_WARNING,
"No wizard is found for the payment type '%s'." % type)
_logger.warning("No wizard found for the payment type '%s'.", type)
return None
def _total(self, cursor, user, ids, name, args, context=None):

View File

@ -103,7 +103,7 @@ class DocIndex(indexer):
return _to_unicode(data)
except OSError:
_logger.warn("Failed attempt to execute antiword (MS Word reader). Antiword is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0])
_logger.warning("Failed attempt to execute antiword (MS Word reader). Antiword is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0])
_logger.debug("Trace of the failed file indexing attempt.", exc_info=True)
return False

View File

@ -29,7 +29,7 @@ _logger = logging.getLogger(__name__)
try:
import controllers
except ImportError:
_logger.warn(
_logger.warning(
"""Could not load openerp-web section of EDI, EDI will not behave correctly
To fix, launch openerp-web in embedded mode""")

View File

@ -425,7 +425,7 @@ class stock_location(osv.osv):
# so we ROLLBACK to the SAVEPOINT to restore the transaction to its earlier
# state, we return False as if the products were not available, and log it:
cr.execute("ROLLBACK TO stock_location_product_reserve")
_logger.warn("Failed attempt to reserve %s x product %s, likely due to another transaction already in progress. Next attempt is likely to work. Detailed error available at DEBUG level.", product_qty, product_id)
_logger.warning("Failed attempt to reserve %s x product %s, likely due to another transaction already in progress. Next attempt is likely to work. Detailed error available at DEBUG level.", product_qty, product_id)
_logger.debug("Trace of the failed product reservation attempt: ", exc_info=True)
return False