diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index f3ed35d0e3bdf0aad3958b84724ede6cff545294..fb6d7459318174bc864b8d0cc813df3d3e65dc00 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -266,33 +266,6 @@ void taosSetAllDebugFlag() { uInfo("all debug flag are set to %d", debugFlag); } } -typedef struct { - char *name; - int32_t len; - void *flag; -} SDynCfgLog; - -bool taosDynCfgDebugFlag(const char *str, int32_t slen, int32_t flag) { - const SDynCfgLog cfgLog[] = { - {"debugFlag", 9, NULL}, {"monDebugFlag", 12, &mDebugFlag}, {"vDebugFlag", 10, &vDebugFlag}, {"mDebugFlag", 10, &mDebugFlag}, - {"cDebugFlag", 10, &cDebugFlag}, {"httpDebugFlag", 13, &httpDebugFlag}, {"qDebugflag", 10, &qDebugFlag}, {"sdbDebugFlag", 12, &sdbDebugFlag}, - {"uDebugFlag", 10, &uDebugFlag}, {"tsdbDebugFlag", 13, &tsdbDebugFlag}, {"sDebugflag", 10, &sDebugFlag}, {"rpcDebugFlag", 12, &rpcDebugFlag}, - {"dDebugFlag", 10, &dDebugFlag}, {"mqttDebugFlag", 13, &mqttDebugFlag}, {"wDebugFlag", 10, &wDebugFlag}, {"tmrDebugFlag", 12, &tmrDebugFlag}, - {"cqDebugFlag", 11, &cqDebugFlag}, - }; - for (int i = 0; i < tListLen(cfgLog); i++) { - if (slen == cfgLog[i].len && strncasecmp(cfgLog[i].name, str, slen) == 0) { - if (cfgLog[i].flag == NULL) { - debugFlag = flag; - taosSetAllDebugFlag(); - } else { - *((int32_t *)(cfgLog[i].flag)) = flag; - } - return true; - } - } - return false; -} bool taosCfgDynamicOptions(char *msg) { char *option, *value; @@ -343,8 +316,10 @@ bool taosCfgDynamicOptions(char *msg) { } return true; } - - return taosDynCfgDebugFlag(cfg->option, olen, vint); + if (strncasecmp(cfg->option, "debugFlag", olen) == 0) { + taosSetAllDebugFlag(); + } + return true; } if (strncasecmp(option, "resetlog", 8) == 0) {