More descriptive and appropriate logging

Contributes to issue CURA-7488.
This commit is contained in:
Ghostkeeper 2020-06-08 17:58:42 +02:00
parent 7e10e74e9e
commit c6af6565a3
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -62,8 +62,9 @@ class ToolPathUploader:
def stop(self):
"""Stops uploading the mesh, marking it as finished."""
Logger.log("i", "Stopped uploading")
self._finished = True
Logger.log("i", "Finished uploading")
self._finished = True # Signal to any ongoing retries that we should stop retrying.
self._on_finished()
def _upload(self) -> None:
"""
@ -88,7 +89,7 @@ class ToolPathUploader:
:param bytes_sent: The amount of bytes sent in the current request.
:param bytes_total: The amount of bytes to send in the current request.
"""
Logger.log("i", "Progress callback %s / %s", bytes_sent, bytes_total)
Logger.debug("Cloud upload progress %s / %s", bytes_sent, bytes_total)
if bytes_total:
self._on_progress(int(bytes_sent / len(self._data) * 100))
@ -128,4 +129,3 @@ class ToolPathUploader:
[bytes(header).decode() for header in reply.rawHeaderList()], bytes(reply.readAll()).decode())
self.stop()
self._on_finished()