File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1424,16 +1424,20 @@ def send_logs(
14241424 platform .system (), self .url , self .username ()
14251425 )
14261426
1427+ # We send more from the local logs
1428+ global_logs_file_size_to_send = MAX_LOG_FILE_SIZE_TO_SEND * 0.2
1429+ local_logs_file_size_to_send = MAX_LOG_FILE_SIZE_TO_SEND * 0.8
1430+
14271431 global_logs = b""
14281432 if global_log_file and os .path .exists (global_log_file ):
14291433 with open (global_log_file , "rb" ) as f :
1430- if os .path .getsize (global_log_file ) > LOG_FILE_SIZE_TO_SEND :
1431- f .seek (- LOG_FILE_SIZE_TO_SEND , os .SEEK_END )
1434+ if os .path .getsize (global_log_file ) > global_logs_file_size_to_send :
1435+ f .seek (- global_logs_file_size_to_send , os .SEEK_END )
14321436 global_logs = f .read () + b"\n --------------------------------\n \n "
14331437
14341438 with open (logfile , "rb" ) as f :
1435- if os .path .getsize (logfile ) > 512 * 1024 :
1436- f .seek (- 512 * 1024 , os .SEEK_END )
1439+ if os .path .getsize (logfile ) > local_logs_file_size_to_send :
1440+ f .seek (- local_logs_file_size_to_send , os .SEEK_END )
14371441 logs = f .read ()
14381442
14391443 payload = meta .encode () + global_logs + logs
Original file line number Diff line number Diff line change 77UPLOAD_CHUNK_SIZE = 10 * 1024 * 1024
88
99# size of the log file part to send (if file is larger only this size from end will be sent)
10- LOG_FILE_SIZE_TO_SEND = 100 * 1024
10+ MAX_LOG_FILE_SIZE_TO_SEND = 8 * 1024 * 1024
1111
1212# default URL for submitting logs
1313MERGIN_DEFAULT_LOGS_URL = "https://g4pfq226j0.execute-api.eu-west-1.amazonaws.com/mergin_client_log_submit"
You can’t perform that action at this time.
0 commit comments