Revision 2cd636fe astakosclient/astakosclient/__init__.py

b/astakosclient/astakosclient/__init__.py
235 235
            headers = {}
236 236
        if body is None:
237 237
            body = {}
238
        # Initialize log_request and log_response attributes
239
        self.log_request = None
240
        self.log_response = None
238 241

  
239 242
        # Build request's header and body
240 243
        kwargs = {}
......
250 253
        try:
251 254
            # Get the connection object
252 255
            with self.conn_class(self.astakos_base_url) as conn:
256
                # Log the request so other clients (like kamaki)
257
                # can use them to produce their own log messages.
258
                self.log_request = dict(method=method, path=request_path)
259
                self.log_request.update(kwargs)
260

  
253 261
                # Send request
254 262
                # Used * or ** magic. pylint: disable-msg=W0142
255 263
                (message, data, status) = \
256 264
                    _do_request(conn, method, request_path, **kwargs)
265

  
266
                # Log the response so other clients (like kamaki)
267
                # can use them to produce their own log messages.
268
                self.log_response = dict(
269
                    status=status, message=message, data=data)
257 270
        except Exception as err:
258 271
            self.logger.error("Failed to send request: %s" % repr(err))
259 272
            raise AstakosClientException(str(err))

Also available in: Unified diff