(improvement)(headless)Opt logging messages to make it cleaner.

This commit is contained in:
jerryjzhang
2024-06-30 13:16:39 +08:00
parent 6687856d59
commit 38b4154b9e
8 changed files with 28 additions and 24 deletions

View File

@@ -137,7 +137,7 @@ public class SearchService {
}
public static void clear() {
log.info("clear all trie");
log.debug("clear all trie");
trie = new BinTrie<>();
suffixTrie = new BinTrie<>();
}

View File

@@ -86,8 +86,6 @@ public class HanlpHelper {
*/
public static boolean reloadCustomDictionary() throws IOException {
log.info("reloadCustomDictionary start");
final long startTime = System.currentTimeMillis();
if (HanLP.Config.CustomDictionaryPath == null || HanLP.Config.CustomDictionaryPath.length == 0) {
@@ -106,7 +104,10 @@ public class HanlpHelper {
SearchService.clear();
boolean reload = getDynamicCustomDictionary().reload();
log.info("reloadCustomDictionary end ,cost:{},reload:{}", System.currentTimeMillis() - startTime, reload);
if (reload) {
log.info("Custom dictionary has been reloaded in {} milliseconds",
System.currentTimeMillis() - startTime);
}
return reload;
}

View File

@@ -35,7 +35,7 @@ public class LLMSqlParser implements SemanticParser {
if (dataSetId == null) {
return;
}
log.info("Generate query statement for dataSetId:{}", dataSetId);
log.info("Try generating query statement for dataSetId:{}", dataSetId);
//3.invoke LLM service to do parsing.
tryParse(queryCtx, dataSetId);
@@ -51,11 +51,11 @@ public class LLMSqlParser implements SemanticParser {
LLMReq llmReq = requestService.getLlmReq(queryCtx, dataSetId);
int currentRetry = 0;
int currentRetry = 1;
Map<String, LLMSqlResp> sqlRespMap = new HashMap<>();
ParseResult parseResult = null;
while (currentRetry < maxRetries) {
log.info("currentRetry:{},start runText2SQL", currentRetry);
while (currentRetry <= maxRetries) {
log.info("currentRetryRound:{}, start runText2SQL", currentRetry);
try {
LLMResp llmResp = requestService.runText2SQL(llmReq);
if (Objects.nonNull(llmResp)) {
@@ -68,7 +68,7 @@ public class LLMSqlParser implements SemanticParser {
}
}
} catch (Exception e) {
log.error("currentRetry:{},runText2SQL error", currentRetry, e);
log.error("currentRetryRound:{}, runText2SQL failed", currentRetry, e);
}
currentRetry++;
}