[domino] pass a logger as argument in the DominoWS constructor

This commit is contained in:
Benjamin Dauvergne 2012-10-01 17:16:11 +02:00
parent 5001e96ffb
commit 06e81b919f
1 changed files with 7 additions and 4 deletions

View File

@ -398,10 +398,13 @@ class DominoWs(object):
invoices dictionnary.
'''
def __init__(self, url, domain, login, password, location=None):
def __init__(self, url, domain, login, password, location=None,
logger=logger):
if not Client:
raise ValueError('You need python suds')
logger.debug('creating DominoWs(%r, %r, %r, %r, location=%r)', url, domain, login, password, location)
self.logger = logger
self.logger.debug('creating DominoWs(%r, %r, %r, %r, location=%r)',
url, domain, login, password, location)
self.url = url
self.domain = domain
self.login = login
@ -423,9 +426,9 @@ class DominoWs(object):
print 'call', function_name, args
try:
logger.debug('soap call to %s%r', function_name, args)
self.logger.debug('soap call to %r(%r)', function_name, args)
data = getattr(self.client.service, function_name)(self.domain, self.login, self.password, *args)
logger.debug('result: %s', data)
self.logger.debug('result: %r', data)
self.data = data
except IOError, e:
raise DominoException('Erreur IO', e)