From 7d89545d3ceb35dd50925f94fc0d2c6561192d65 Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Wed, 30 Oct 2024 10:26:49 +0800 Subject: [PATCH 1/2] enh: alter taosCheckAndSetDebugFlag log level --- source/common/src/tglobal.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 5ab5500fa6..4076679ff4 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -2346,8 +2346,13 @@ static void taosCheckAndSetDebugFlag(int32_t *pFlagPtr, char *name, int32_t flag if (noNeedToSetVars != NULL && taosArraySearch(noNeedToSetVars, name, taosLogVarComp, TD_EQ) != NULL) { return; } - if (taosSetDebugFlag(pFlagPtr, name, flag) != 0) { - uError("failed to set flag %s to %d", name, flag); + int32_t code = 0; + if ((code = taosSetDebugFlag(pFlagPtr, name, flag)) != 0) { + if (code != TSDB_CODE_CFG_NOT_FOUND) { + uError("failed to set flag %s to %d", name, flag); + } else { + uDebug("failed to set flag %s to %d", name, flag); + } } return; } From fd1f3ba048e90a750961acab8a3257a7b9538f4c Mon Sep 17 00:00:00 2001 From: Shungang Li Date: Thu, 31 Oct 2024 11:40:39 +0800 Subject: [PATCH 2/2] enh: taosCheckAndSetDebugFlag print errstr --- source/common/src/tglobal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 4076679ff4..00052cc810 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -2349,9 +2349,9 @@ static void taosCheckAndSetDebugFlag(int32_t *pFlagPtr, char *name, int32_t flag int32_t code = 0; if ((code = taosSetDebugFlag(pFlagPtr, name, flag)) != 0) { if (code != TSDB_CODE_CFG_NOT_FOUND) { - uError("failed to set flag %s to %d", name, flag); + uError("failed to set flag %s to %d, since:%s", name, flag, tstrerror(code)); } else { - uDebug("failed to set flag %s to %d", name, flag); + uDebug("failed to set flag %s to %d, since:%s", name, flag, tstrerror(code)); } } return;