Commit 4d446aefbe4aee2f7fc6297b647d90f1926f8055

Authored by Hu Chunming
1 parent 9a922a54

日志优化

src/ai_platform/MultiSourceProcess.cpp
@@ -1126,16 +1126,16 @@ void CMultiSourceProcess::vehicle_locus_finished(const OBJ_KEY obj_key) { @@ -1126,16 +1126,16 @@ void CMultiSourceProcess::vehicle_locus_finished(const OBJ_KEY obj_key) {
1126 } 1126 }
1127 auto task_other_param = it_other_param->second; 1127 auto task_other_param = it_other_param->second;
1128 1128
1129 - LOG_DEBUG("algor_type"); 1129 + // LOG_DEBUG("algor_type");
1130 auto algor_type = index_to_algo_type[obj_value.index.index]; 1130 auto algor_type = index_to_algo_type[obj_value.index.index];
1131 1131
1132 - LOG_DEBUG("task_other_param"); 1132 + // LOG_DEBUG("task_other_param");
1133 auto it_algor_type = task_other_param.find(algor_type); 1133 auto it_algor_type = task_other_param.find(algor_type);
1134 if(it_algor_type == task_other_param.end()) { 1134 if(it_algor_type == task_other_param.end()) {
1135 return; 1135 return;
1136 } 1136 }
1137 1137
1138 - LOG_DEBUG("algor_param"); 1138 + // LOG_DEBUG("algor_param");
1139 auto algor_param = (algor_config_param_snapshot *)it_algor_type->second->algor_param; 1139 auto algor_param = (algor_config_param_snapshot *)it_algor_type->second->algor_param;
1140 if(algor_param == nullptr) { 1140 if(algor_param == nullptr) {
1141 return; 1141 return;
@@ -1148,7 +1148,7 @@ void CMultiSourceProcess::vehicle_locus_finished(const OBJ_KEY obj_key) { @@ -1148,7 +1148,7 @@ void CMultiSourceProcess::vehicle_locus_finished(const OBJ_KEY obj_key) {
1148 return; 1148 return;
1149 } 1149 }
1150 1150
1151 - LOG_DEBUG("cur_param"); 1151 + // LOG_DEBUG("cur_param");
1152 const algor_basic_config_param_t *cur_param = it_algor_type->second->basic_param; 1152 const algor_basic_config_param_t *cur_param = it_algor_type->second->basic_param;
1153 // const algor_basic_config_param_t *cur_param = task_other_param[algor_type]->basic_param; 1153 // const algor_basic_config_param_t *cur_param = task_other_param[algor_type]->basic_param;
1154 if(cur_param == nullptr) { 1154 if(cur_param == nullptr) {
@@ -1156,7 +1156,7 @@ void CMultiSourceProcess::vehicle_locus_finished(const OBJ_KEY obj_key) { @@ -1156,7 +1156,7 @@ void CMultiSourceProcess::vehicle_locus_finished(const OBJ_KEY obj_key) {
1156 } 1156 }
1157 1157
1158 // 原图 1158 // 原图
1159 - LOG_DEBUG("原图"); 1159 + // LOG_DEBUG("原图");
1160 std::string cur_timestamp_ms = std::to_string(helpers::timer::get_cur_time_ms()); 1160 std::string cur_timestamp_ms = std::to_string(helpers::timer::get_cur_time_ms());
1161 std::string fpath_origin = std::string(cur_param->result_folder) + helpers::os::sep + obj_key.video_id + "_" + 1161 std::string fpath_origin = std::string(cur_param->result_folder) + helpers::os::sep + obj_key.video_id + "_" +
1162 std::to_string(obj_key.obj_id) + "_" + cur_timestamp_ms + ".jpg"; 1162 std::to_string(obj_key.obj_id) + "_" + cur_timestamp_ms + ".jpg";
@@ -1168,7 +1168,7 @@ void CMultiSourceProcess::vehicle_locus_finished(const OBJ_KEY obj_key) { @@ -1168,7 +1168,7 @@ void CMultiSourceProcess::vehicle_locus_finished(const OBJ_KEY obj_key) {
1168 m_save_snapshot_reprocessing->reprocessing_process_wo_locus_async(origin_save_info); 1168 m_save_snapshot_reprocessing->reprocessing_process_wo_locus_async(origin_save_info);
1169 1169
1170 { 1170 {
1171 - LOG_DEBUG("抠图"); 1171 + // LOG_DEBUG("抠图");
1172 // 抠图 1172 // 抠图
1173 string json_str = ""; 1173 string json_str = "";
1174 string object_file_name = std::string(cur_param->result_folder_little) + helpers::os::sep + obj_key.video_id + "_" + 1174 string object_file_name = std::string(cur_param->result_folder_little) + helpers::os::sep + obj_key.video_id + "_" +
@@ -1868,7 +1868,7 @@ void CMultiSourceProcess::village_snapshot(vector<string>& vpt_interest_task_id, @@ -1868,7 +1868,7 @@ void CMultiSourceProcess::village_snapshot(vector<string>& vpt_interest_task_id,
1868 for (int sp_idx = 0; sp_idx < 3; sp_idx ++) { 1868 for (int sp_idx = 0; sp_idx < 3; sp_idx ++) {
1869 int num = sp_idx + 1; 1869 int num = sp_idx + 1;
1870 // 原图 1870 // 原图
1871 - LOG_DEBUG("原图"); 1871 + // LOG_DEBUG("原图");
1872 std::string fpath_origin = result_folder + helpers::os::sep + obj_key.video_id + "_" + 1872 std::string fpath_origin = result_folder + helpers::os::sep + obj_key.video_id + "_" +
1873 std::to_string(obj_key.obj_id) + "_" + cur_timestamp_ms + "_picnum_" + std::to_string(num) + ".jpg"; 1873 std::to_string(obj_key.obj_id) + "_" + cur_timestamp_ms + "_picnum_" + std::to_string(num) + ".jpg";
1874 1874
@@ -1879,7 +1879,7 @@ void CMultiSourceProcess::village_snapshot(vector&lt;string&gt;&amp; vpt_interest_task_id, @@ -1879,7 +1879,7 @@ void CMultiSourceProcess::village_snapshot(vector&lt;string&gt;&amp; vpt_interest_task_id,
1879 m_save_snapshot_reprocessing->reprocessing_process_wo_locus_async(origin_save_info); 1879 m_save_snapshot_reprocessing->reprocessing_process_wo_locus_async(origin_save_info);
1880 1880
1881 1881
1882 - LOG_DEBUG("抠图"); 1882 + // LOG_DEBUG("抠图");
1883 // 抠图 1883 // 抠图
1884 string object_file_name = result_folder_little + helpers::os::sep + obj_key.video_id + "_" + 1884 string object_file_name = result_folder_little + helpers::os::sep + obj_key.video_id + "_" +
1885 std::to_string(obj_key.obj_id) + "_" + cur_timestamp_ms + "_picnum_" + std::to_string(num) + ".jpg"; 1885 std::to_string(obj_key.obj_id) + "_" + cur_timestamp_ms + "_picnum_" + std::to_string(num) + ".jpg";
src/decoder/gb28181/websocket/WebsocketClient.cpp
@@ -12,17 +12,17 @@ using websocketpp::lib::placeholders::_2; @@ -12,17 +12,17 @@ using websocketpp::lib::placeholders::_2;
12 12
13 void WebsocketClient::on_open(websocketpp::connection_hdl hdl) 13 void WebsocketClient::on_open(websocketpp::connection_hdl hdl)
14 { 14 {
15 - std::cout << "连接sip服务器成功!" << std::endl; 15 + LOG_INFO( "连接sip服务器成功!");
16 mbClosed = false; 16 mbClosed = false;
17 } 17 }
18 18
19 void WebsocketClient::on_fail(websocketpp::connection_hdl h){ 19 void WebsocketClient::on_fail(websocketpp::connection_hdl h){
20 - std::cout << "连接sip服务器失败!" << std::endl; 20 + LOG_INFO( "连接sip服务器失败!");
21 mbClosed = true; 21 mbClosed = true;
22 } 22 }
23 23
24 void WebsocketClient::on_close(websocketpp::connection_hdl h){ 24 void WebsocketClient::on_close(websocketpp::connection_hdl h){
25 - std::cout << "on_close" << std::endl; 25 + LOG_INFO( "on_close");
26 mbClosed = true; 26 mbClosed = true;
27 } 27 }
28 28
@@ -33,7 +33,7 @@ void WebsocketClient::on_message(websocketpp::connection_hdl hdl, message_ptr ms @@ -33,7 +33,7 @@ void WebsocketClient::on_message(websocketpp::connection_hdl hdl, message_ptr ms
33 // 返回执行结果 33 // 返回执行结果
34 // ws_server.send(hdl, to_string(ret), websocketpp::frame::opcode::text); 34 // ws_server.send(hdl, to_string(ret), websocketpp::frame::opcode::text);
35 } catch (websocketpp::exception const & e) { 35 } catch (websocketpp::exception const & e) {
36 - std::cout << "Echo failed because: " << "(" << e.what() << ")" << std::endl; 36 + LOG_ERROR( "Echo failed because:({})", e.what());
37 } 37 }
38 } 38 }
39 39
@@ -56,9 +56,7 @@ int WebsocketClient::msg_parser(websocketpp::connection_hdl hdl, string msg) { @@ -56,9 +56,7 @@ int WebsocketClient::msg_parser(websocketpp::connection_hdl hdl, string msg) {
56 std::cout << "bye invite: " << vec_msg[2] << std::endl; 56 std::cout << "bye invite: " << vec_msg[2] << std::endl;
57 } 57 }
58 } else { 58 } else {
59 - std::cout << "on_message called with hdl: " << hdl.lock().get()  
60 - << " and message: " << msg  
61 - << std::endl; 59 + LOG_ERROR( "on_message called with hdl:{} and message:{}",hdl.lock().get(), msg);
62 } 60 }
63 61
64 return ret; 62 return ret;
@@ -90,6 +88,7 @@ int WebsocketClient::init() @@ -90,6 +88,7 @@ int WebsocketClient::init()
90 } 88 }
91 89
92 uri = "ws://" + mInfo.getWsIp() + ":" + to_string(mInfo.getWsPort()); 90 uri = "ws://" + mInfo.getWsIp() + ":" + to_string(mInfo.getWsPort());
  91 + LOG_INFO("{}", uri);
93 92
94 m_client.set_access_channels(websocketpp::log::alevel::all); 93 m_client.set_access_channels(websocketpp::log::alevel::all);
95 m_client.clear_access_channels(websocketpp::log::alevel::frame_payload); 94 m_client.clear_access_channels(websocketpp::log::alevel::frame_payload);