@@ -119,12 +119,11 @@ def delete_files(request: Request) -> HTTPNoContent:
119
119
120
120
# Log the deletions from db
121
121
for user_uuid , file_uuid , storage_uri in deleted_files :
122
- log .info (f"[DB_FILE][DELETE][user={ user_uuid } ][file={ file_uuid } ]" )
123
-
122
+ log .info ("File record deleted from the database." , extra = {"user_uuid" : user_uuid , "file_uuid" : file_uuid })
124
123
# Delete the files from storage
125
124
for user_uuid , file_uuid , storage_uri in deleted_files :
126
125
storage .rm (request , storage_uri )
127
- log .info (f"[STORAGE][DELETE][user= { user_uuid } ][file= { file_uuid } ]" )
126
+ log .info ("File deleted from storage." , extra = { " user_uuid" : user_uuid , " file_uuid" : file_uuid } )
128
127
129
128
return HTTPNoContent ()
130
129
@@ -261,7 +260,7 @@ def update_file(request: Request) -> HTTPOk:
261
260
except storage .ChecksumMismatchError :
262
261
# Checksum of uploaded data does not match announcement
263
262
raise HTTPConflict (json = None ) # 409
264
- log .info (f"[STORAGE][FREEZE][user= { db_file .user .uuid } ][file= { db_file .uuid } ]" )
263
+ log .info ("Storage file frozen." , extra = { "user_uuid" : db_file .user .uuid , "file_uuid" : db_file .uuid })
265
264
266
265
return FileResponse (
267
266
id = resource .get_identifier (db_file ),
@@ -317,10 +316,9 @@ def delete_file(request: Request) -> HTTPNoContent:
317
316
# Commit transaction
318
317
request .tm .commit ()
319
318
request .tm .begin ()
320
- log .info (f"[DB_FILE][DELETE][user={ user_uuid } ][file={ file_uuid } ]" )
321
-
319
+ log .info ("File record deleted from the database." , extra = {"user_uuid" : user_uuid , "file_uuid" : file_uuid })
322
320
# Delete the file in storage if exists
323
321
storage .rm (request , storage_uri )
324
- log .info (f"[STORAGE][DELETE][user= { user_uuid } ][file= { file_uuid } ]" )
322
+ log .info ("File deleted from storage." , extra = { " user_uuid" : user_uuid , " file_uuid" : file_uuid } )
325
323
326
324
return HTTPNoContent ()
0 commit comments