Commit 3d2bfa2c authored by Mitar's avatar Mitar
Browse files

Add logging calls.

parent daea31ca
......@@ -129,10 +129,12 @@ class SumPrimitive(base.SingletonOutputMixin[Inputs, Outputs, None, Hyperparams]
# This simple primitive does not keep any state in the Docker container.
# But if your primitive does have to associate requests with a primitive, consider
# using Python's "id(self)" call to get an identifier of a primitive's instance.
self.logger.debug("HTTP request: host=%(host)s port=%(port)s", {'host': self.docker_containers[DOCKER_KEY], 'port': 8000}, extra={'data': value})
connection.request('POST', '/', data, {
'Content-Type': 'multipart/form-data',
response = connection.getresponse()
self.logger.debug("HTTP response: status=%(status)s", {'status': response.status}, extra={'response': response})
if response.status != 200:
raise ValueError("Invalid HTTP response status: {status}".format(status=response.status))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment