mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:26:30 +00:00
write logs for inference and loader to file
This commit is contained in:
@@ -47,7 +47,7 @@ cdef class ApiClient:
|
||||
token = response.json()["token"]
|
||||
self.set_token(token)
|
||||
except HTTPError as e:
|
||||
constants.log(response.json())
|
||||
constants.logerror(response.json())
|
||||
if response.status_code == HTTPStatus.CONFLICT:
|
||||
res = response.json()
|
||||
raise Exception(res['Message'])
|
||||
@@ -95,7 +95,7 @@ cdef class ApiClient:
|
||||
r.raise_for_status()
|
||||
constants.log(f"Uploaded {filename} to {self.api_url}/{folder} successfully: {r.status_code}.")
|
||||
except Exception as e:
|
||||
constants.log(f"Upload fail: {e}")
|
||||
constants.logerror(f"Upload fail: {e}")
|
||||
|
||||
cdef list_files(self, str folder, str search_file):
|
||||
response = self.request('get', f'{self.api_url}/resources/list/{folder}', {
|
||||
@@ -173,7 +173,7 @@ cdef class ApiClient:
|
||||
resource = Security.decrypt_to(encrypted_bytes_small + local_bytes_big, key)
|
||||
return resource
|
||||
except Exception as ex:
|
||||
constants.log('Local file {folder}\\{big_part} doesnt match with api file, old version')
|
||||
constants.logerror('Local file {folder}\\{big_part} doesnt match with api file, old version')
|
||||
|
||||
remote_bytes_big = self.load_big_file_cdn(folder, big_part)
|
||||
return Security.decrypt_to(encrypted_bytes_small + remote_bytes_big, key)
|
||||
|
||||
Reference in New Issue
Block a user