chore.优化调试日志和调试宏

This commit is contained in:
MistEO
2022-01-04 15:15:49 +08:00
parent 1f454a2e45
commit 0d081cd4c3
15 changed files with 298 additions and 297 deletions

View File

@@ -202,9 +202,7 @@ size_t asst::InfrastProductionTask::opers_detect()
[&cur_oper](const infrast::Oper& oper) -> bool {
// 有可能是同一个干员比一下hash
int dist = utils::hamming(cur_oper.face_hash, oper.face_hash);
#ifdef LOG_TRACE
Log.trace("opers_detect hash dist |", dist);
#endif
Log.debug("opers_detect hash dist |", dist);
return dist < m_face_hash_thres;
});
// 如果两个的hash距离过小则认为是同一个干员不进行插入
@@ -370,9 +368,7 @@ bool asst::InfrastProductionTask::optimal_calc()
if (!opt.possible_hashs.empty()) {
for (const auto& [key, hash] : opt.possible_hashs) {
int dist = utils::hamming(find_iter->name_hash, hash);
#ifdef LOG_TRACE
Log.trace("optimal_calc | name hash dist", dist, hash, find_iter->name_hash);
#endif
Log.debug("optimal_calc | name hash dist", dist, hash, find_iter->name_hash);
if (dist < m_name_hash_thres) {
hash_matched = true;
break;
@@ -498,9 +494,7 @@ bool asst::InfrastProductionTask::opers_choose()
// 既要技能相同也要hash相同双重校验
for (const auto& [_, hash] : opt_iter->possible_hashs) {
int dist = utils::hamming(lhs.name_hash, hash);
#ifdef LOG_TRACE
Log.trace("opers_choose | name hash dist", dist);
#endif
Log.debug("opers_choose | name hash dist", dist);
if (dist < m_name_hash_thres) {
return true;
}
@@ -529,9 +523,7 @@ bool asst::InfrastProductionTask::opers_choose()
m_all_available_opers.cbegin(), m_all_available_opers.cend(),
[&](const infrast::Oper& lhs) -> bool {
int dist = utils::hamming(lhs.face_hash, find_iter->face_hash);
#ifdef LOG_TRACE
Log.trace("opers_choose | face hash dist", dist);
#endif
Log.debug("opers_choose | face hash dist", dist);
if (dist < m_face_hash_thres) {
return true;
}