diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 9633b3e8aadbc95737e2325887eff0115b44cfcf..ac998b807e2c6124c12d36867b268a799e9f2d9d 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -153,6 +153,8 @@ void taosAddDataDir(int32_t index, char *v1, int32_t level, int32_t primary); struct SConfig *taosGetCfg(); +void taosSetAllDebugFlag(int32_t flag); +void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal); int32_t taosSetCfg(SConfig *pCfg, char *name); #ifdef __cplusplus diff --git a/include/util/tlog.h b/include/util/tlog.h index 04ffe21e0bf0b6aa7084b0330c8b8ae165f4127f..76d04a5997f1247d830e435bd2a2b1058fc0f0ec 100644 --- a/include/util/tlog.h +++ b/include/util/tlog.h @@ -67,8 +67,6 @@ extern int32_t idxDebugFlag; int32_t taosInitLog(const char *logName, int32_t maxFiles); void taosCloseLog(); void taosResetLog(); -void taosSetAllDebugFlag(int32_t flag); -void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal); void taosDumpData(uint8_t *msg, int32_t len); void taosPrintLog(const char *flags, ELogLevel level, int32_t dflag, const char *format, ...) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 5cb5148e302953bf94108ffd1a52fe04557beb30..7a20969a633d5d349c7cb0944e6c1162edec14ef 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -1176,3 +1176,33 @@ void taosCfgDynamicOptions(const char *option, const char *value) { uError("failed to cfg dynamic option:%s value:%s", option, value); } + +void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal) { + SConfigItem *pItem = cfgGetItem(tsCfg, flagName); + if (pItem != NULL) { + pItem->i32 = flagVal; + } + *pFlagPtr = flagVal; +} + +void taosSetAllDebugFlag(int32_t flag) { + if (flag <= 0) return; + + taosSetDebugFlag(&uDebugFlag, "uDebugFlag", flag); + taosSetDebugFlag(&rpcDebugFlag, "rpcDebugFlag", flag); + taosSetDebugFlag(&jniDebugFlag, "jniDebugFlag", flag); + taosSetDebugFlag(&qDebugFlag, "qDebugFlag", flag); + taosSetDebugFlag(&cDebugFlag, "cDebugFlag", flag); + taosSetDebugFlag(&dDebugFlag, "dDebugFlag", flag); + taosSetDebugFlag(&vDebugFlag, "vDebugFlag", flag); + taosSetDebugFlag(&mDebugFlag, "mDebugFlag", flag); + taosSetDebugFlag(&wDebugFlag, "wDebugFlag", flag); + taosSetDebugFlag(&sDebugFlag, "sDebugFlag", flag); + taosSetDebugFlag(&tsdbDebugFlag, "tsdbDebugFlag", flag); + taosSetDebugFlag(&tqDebugFlag, "tqDebugFlag", flag); + taosSetDebugFlag(&fsDebugFlag, "fsDebugFlag", flag); + taosSetDebugFlag(&udfDebugFlag, "udfDebugFlag", flag); + taosSetDebugFlag(&smaDebugFlag, "smaDebugFlag", flag); + taosSetDebugFlag(&idxDebugFlag, "idxDebugFlag", flag); + uInfo("all debug flag are set to %d", flag); +} diff --git a/source/util/src/tlog.c b/source/util/src/tlog.c index 678a12fcf14b7980cda1dcdc81f739a4721f2c27..a71a75eac5844227d6249f0df2dc03d159a482e2 100644 --- a/source/util/src/tlog.c +++ b/source/util/src/tlog.c @@ -743,33 +743,3 @@ cmp_end: return ret; } - -void taosSetDebugFlag(int32_t *pFlagPtr, const char *flagName, int32_t flagVal) { - SConfigItem *pItem = cfgGetItem(tsCfg, flagName); - if (pItem != NULL) { - pItem->i32 = flagVal; - } - *pFlagPtr = flagVal; -} - -void taosSetAllDebugFlag(int32_t flag) { - if (flag <= 0) return; - - taosSetDebugFlag(&uDebugFlag, "uDebugFlag", flag); - taosSetDebugFlag(&rpcDebugFlag, "rpcDebugFlag", flag); - taosSetDebugFlag(&jniDebugFlag, "jniDebugFlag", flag); - taosSetDebugFlag(&qDebugFlag, "qDebugFlag", flag); - taosSetDebugFlag(&cDebugFlag, "cDebugFlag", flag); - taosSetDebugFlag(&dDebugFlag, "dDebugFlag", flag); - taosSetDebugFlag(&vDebugFlag, "vDebugFlag", flag); - taosSetDebugFlag(&mDebugFlag, "mDebugFlag", flag); - taosSetDebugFlag(&wDebugFlag, "wDebugFlag", flag); - taosSetDebugFlag(&sDebugFlag, "sDebugFlag", flag); - taosSetDebugFlag(&tsdbDebugFlag, "tsdbDebugFlag", flag); - taosSetDebugFlag(&tqDebugFlag, "tqDebugFlag", flag); - taosSetDebugFlag(&fsDebugFlag, "fsDebugFlag", flag); - taosSetDebugFlag(&udfDebugFlag, "udfDebugFlag", flag); - taosSetDebugFlag(&smaDebugFlag, "smaDebugFlag", flag); - taosSetDebugFlag(&idxDebugFlag, "idxDebugFlag", flag); - uInfo("all debug flag are set to %d", flag); -}