File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ def generate_and_send_logs(
3131 """Generates log data which includes the base_log_data, additional_log_data, and time taken (calculated using the
3232 current time and given start_time) and sends them to Cloudwatch and Firehose."""
3333 seconds_elapsed = time .time () - start_time
34- time_elapsed = f"{ round (seconds_elapsed * 1000 , 5 )} ms" if use_ms_precision else f"{ round (seconds_elapsed , 5 )} s"
34+ formatted_time_elapsed = f"{ round (seconds_elapsed * 1000 , 5 )} ms" if use_ms_precision else \
35+ f"{ round (seconds_elapsed , 5 )} s"
3536
36- log_data = {** base_log_data , "time_taken" : time_elapsed , ** additional_log_data }
37+ log_data = {** base_log_data , "time_taken" : formatted_time_elapsed , ** additional_log_data }
3738 log_function = logger .error if is_error_log else logger .info
3839 log_function (json .dumps (log_data ))
3940 send_log_to_firehose (log_data )
You can’t perform that action at this time.
0 commit comments