|
@@ -44,8 +44,13 @@ def method_v001(client, userdata, message):
|
|
methods.debug_log("method_v001|41", f"#traceback: {traceback.format_exc()}")
|
|
methods.debug_log("method_v001|41", f"#traceback: {traceback.format_exc()}")
|
|
return
|
|
return
|
|
|
|
|
|
- # --- fill log_list ---
|
|
|
|
|
|
+ # --- check ---
|
|
log_uuid = UserWorkRecord.get_log_uuid(user_uuid, log_time, vehicle_id, cockpit_id)
|
|
log_uuid = UserWorkRecord.get_log_uuid(user_uuid, log_time, vehicle_id, cockpit_id)
|
|
|
|
+ if not log_uuid:
|
|
|
|
+ methods.debug_log(f"MessageListenerV001|error50", f"user_uuid: {user_uuid}, log_time: {log_time}")
|
|
|
|
+ return
|
|
|
|
+
|
|
|
|
+ # --- fill log_list ---
|
|
log_list = [
|
|
log_list = [
|
|
|
|
|
|
f"timestamp: {methods.ts_to_string(log_time)}", # 时间
|
|
f"timestamp: {methods.ts_to_string(log_time)}", # 时间
|
|
@@ -108,8 +113,8 @@ def method_v001(client, userdata, message):
|
|
LocalClass.last_log_key = log_key
|
|
LocalClass.last_log_key = log_key
|
|
|
|
|
|
# --- save ---
|
|
# --- save ---
|
|
|
|
+ # methods.debug_log(f"MessageListenerV001|113", f"#log_list: {log_list}")
|
|
log_file_path = os.path.join(save_dir, f'{log_uuid}.log')
|
|
log_file_path = os.path.join(save_dir, f'{log_uuid}.log')
|
|
- methods.debug_log(f"MessageListenerV001|113", f"#log_list: {log_list}")
|
|
|
|
methods.write_text(log_file_path, ' | '.join(log_list) + '\n', 'a')
|
|
methods.write_text(log_file_path, ' | '.join(log_list) + '\n', 'a')
|
|
|
|
|
|
|
|
|