4747except ImportError as e :
4848 from xml .parsers .expat import ExpatError as ParseError
4949
50+ logger = logging .getLogger (__name__ )
5051
5152__all__ = [
5253 "AuthenticationError" ,
@@ -68,7 +69,7 @@ def new_f(*args, **kwargs):
6869 start_time = datetime .now ()
6970 val = f (* args , ** kwargs )
7071 end_time = datetime .now ()
71- logging .debug ("Operation took %s" , end_time - start_time )
72+ logger .debug ("Operation took %s" , end_time - start_time )
7273 return val
7374 return new_f
7475
@@ -616,7 +617,7 @@ def delete(self, path_segment, owner=None, app=None, sharing=None, **query):
616617 """
617618 path = self .authority + self ._abspath (path_segment , owner = owner ,
618619 app = app , sharing = sharing )
619- logging .debug ("DELETE request to %s (body: %s)" , path , repr (query ))
620+ logger .debug ("DELETE request to %s (body: %s)" , path , repr (query ))
620621 response = self .http .delete (path , self ._auth_headers , ** query )
621622 return response
622623
@@ -679,7 +680,7 @@ def get(self, path_segment, owner=None, app=None, headers=None, sharing=None, **
679680
680681 path = self .authority + self ._abspath (path_segment , owner = owner ,
681682 app = app , sharing = sharing )
682- logging .debug ("GET request to %s (body: %s)" , path , repr (query ))
683+ logger .debug ("GET request to %s (body: %s)" , path , repr (query ))
683684 all_headers = headers + self .additional_headers + self ._auth_headers
684685 response = self .http .get (path , all_headers , ** query )
685686 return response
@@ -757,7 +758,7 @@ def post(self, path_segment, owner=None, app=None, sharing=None, headers=None, *
757758 headers = []
758759
759760 path = self .authority + self ._abspath (path_segment , owner = owner , app = app , sharing = sharing )
760- logging .debug ("POST request to %s (body: %s)" , path , repr (query ))
761+ logger .debug ("POST request to %s (body: %s)" , path , repr (query ))
761762 all_headers = headers + self .additional_headers + self ._auth_headers
762763 response = self .http .post (path , all_headers , ** query )
763764 return response
@@ -826,7 +827,7 @@ def request(self, path_segment, method="GET", headers=None, body={},
826827 app = app , sharing = sharing )
827828
828829 all_headers = headers + self .additional_headers + self ._auth_headers
829- logging .debug ("%s request to %s (headers: %s, body: %s)" ,
830+ logger .debug ("%s request to %s (headers: %s, body: %s)" ,
830831 method , path , str (all_headers ), repr (body ))
831832
832833 if body :
0 commit comments