revert some code

This commit is contained in:
yihaoDeng 2021-02-04 06:35:31 +00:00
parent 992842ff51
commit dabf6f9579
1 changed files with 4 additions and 29 deletions

View File

@ -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) {