diff --git a/include/common/tglobal.h b/include/common/tglobal.h index f03943e1053dd1cc8834afa6fa0823ce62443c7e..5022cb7be80773460f42844af10cc17290de658b 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -18,6 +18,7 @@ #include "tarray.h" #include "tdef.h" +#include "tconfig.h" #ifdef __cplusplus extern "C" { @@ -129,6 +130,7 @@ void taosCfgDynamicOptions(const char *option, const char *value); void taosAddDataDir(int32_t index, char *v1, int32_t level, int32_t primary); struct SConfig *taosGetCfg(); +int32_t taosAddClientLogCfg(SConfig *pCfg); #ifdef __cplusplus } diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 0bc1fa09f519ea49af319a8ab4a80afe5966766c..df4433e6e41c87b28761711b185c4919b663cfcf 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -256,7 +256,7 @@ static int32_t taosLoadCfg(SConfig *pCfg, const char *inputCfgDir, const char *e return 0; } -static int32_t taosAddClientLogCfg(SConfig *pCfg) { +int32_t taosAddClientLogCfg(SConfig *pCfg) { if (cfgAddDir(pCfg, "configDir", configDir, 1) != 0) return -1; if (cfgAddDir(pCfg, "scriptDir", configDir, 1) != 0) return -1; if (cfgAddDir(pCfg, "logDir", tsLogDir, 1) != 0) return -1; diff --git a/tools/shell/src/shellEngine.c b/tools/shell/src/shellEngine.c index 0e611f379410245a041002bf27bc7b11b9557f46..b89d517ad3e4396d1472e0b0a6a8a7d2333ab7c5 100644 --- a/tools/shell/src/shellEngine.c +++ b/tools/shell/src/shellEngine.c @@ -26,6 +26,7 @@ #include "tglobal.h" #include "ttypes.h" #include "tutil.h" +#include "tconfig.h" #include #include @@ -90,6 +91,11 @@ TAOS *shellInit(SShellArguments *_args) { _args->user = TSDB_DEFAULT_USER; } + SConfig *pCfg = cfgInit(); + if (NULL == pCfg) return NULL; + + if (0 != taosAddClientLogCfg(pCfg)) return NULL; + // Connect to the database. TAOS *con = NULL; if (_args->auth == NULL) { diff --git a/tools/taos-tools b/tools/taos-tools index 33cdfe4f90a209f105c1b6091439798a9cde1e93..bf6c766986c61ff4fc80421fdea682a8fd4b5b32 160000 --- a/tools/taos-tools +++ b/tools/taos-tools @@ -1 +1 @@ -Subproject commit 33cdfe4f90a209f105c1b6091439798a9cde1e93 +Subproject commit bf6c766986c61ff4fc80421fdea682a8fd4b5b32