提交 1383e53d 编写于 作者: S Shengliang Guan

tsim cfg

上级 6aab9380
......@@ -217,6 +217,10 @@ static void taosAddClientLogCfg(SConfig *pCfg) {
cfgAddInt32(pCfg, "rpcDebugFlag", rpcDebugFlag, 0, 255, 1);
cfgAddInt32(pCfg, "tmrDebugFlag", tmrDebugFlag, 0, 255, 1);
cfgAddInt32(pCfg, "jniDebugFlag", jniDebugFlag, 0, 255, 1);
cfgAddInt32(pCfg, "simDebugFlag", 143, 0, 255, 1);
cfgAddDir(pCfg, "configDir", configDir, 1);
cfgAddDir(pCfg, "scriptDir", configDir, 1);
cfgAddInt32(pCfg, "debugFlag", 0, 0, 255, 1);
}
static void taosAddServerLogCfg(SConfig *pCfg) {
......@@ -229,8 +233,6 @@ static void taosAddServerLogCfg(SConfig *pCfg) {
cfgAddInt32(pCfg, "tsdbDebugFlag", tsdbDebugFlag, 0, 255, 0);
cfgAddInt32(pCfg, "tqDebugFlag", tqDebugFlag, 0, 255, 0);
cfgAddInt32(pCfg, "fsDebugFlag", fsDebugFlag, 0, 255, 0);
cfgAddInt32(pCfg, "simDebugFlag", 143, 0, 255, 1);
cfgAddInt32(pCfg, "debugFlag", 0, 0, 255, 1);
}
static void taosAddClientCfg(SConfig *pCfg) {
......@@ -246,8 +248,6 @@ static void taosAddClientCfg(SConfig *pCfg) {
cfgAddString(pCfg, "secondEp", defaultSecondEp, 1);
cfgAddString(pCfg, "fqdn", defaultFqdn, 1);
cfgAddInt32(pCfg, "serverPort", defaultServerPort, 1, 65056, 1);
cfgAddString(pCfg, "configDir", configDir, 1);
cfgAddString(pCfg, "scriptDir", configDir, 1);
cfgAddDir(pCfg, "tempDir", osTempDir(), 1);
cfgAddFloat(pCfg, "minimalTempDirGB", 1.0f, 0.001f, 10000000, 1);
cfgAddFloat(pCfg, "numOfThreadsPerCore", tsNumOfThreadsPerCore, 0, 10, 1);
......@@ -300,6 +300,7 @@ static void taosAddServerCfg(SConfig *pCfg) {
}
static void taosSetClientLogCfg(SConfig *pCfg) {
SConfigItem *pItem = cfgGetItem(pCfg, "logDir");
osSetLogDir(cfgGetItem(pCfg, "logDir")->str);
osSetDataReservedSpace(cfgGetItem(pCfg, "minimalLogDirGB")->fval);
tsNumOfLogLines = cfgGetItem(pCfg, "numOfLogLines")->i32;
......@@ -397,6 +398,8 @@ static void taosSetServerCfg(SConfig *pCfg) {
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char *envFile,
const char *apolloUrl, bool tsc) {
osInit();
SConfig *pCfg = cfgInit();
if (pCfg == NULL) return -1;
......
......@@ -97,8 +97,6 @@ int32_t dmnRunDnode() {
}
int main(int argc, char const *argv[]) {
osInit();
if (dmnParseOption(argc, argv) != 0) {
return -1;
}
......
......@@ -92,21 +92,27 @@ void osInit() {
strcpy(env.tempDir, tmpDir);
}
if (configDir[0] == 0) {
strcpy(configDir, "C:\\TDengine\\cfg");
}
strcpy(env.dataDir, "C:\\TDengine\\data");
strcpy(env.logDir, "C:\\TDengine\\log");
strcpy(env.tempDir, "C:\\Windows\\Temp");
strcpy(env.osName, "Windows");
#elif defined(_TD_DARWIN_64)
if (configDir[0] == 0) {
strcpy(configDir, "/tmp/taosd");
}
strcpy(env.dataDir, "/usr/local/var/lib/taos");
strcpy(env.logDir, "/usr/local/var/log/taos");
strcpy(env.tempDir, "/usr/local/etc/taos");
strcpy(env.osName, "Darwin");
#else
if (configDir[0] == 0) {
strcpy(configDir, "/etc/taos");
}
strcpy(env.dataDir, "/var/lib/taos");
strcpy(env.logDir, "/var/log/taos");
strcpy(env.tempDir, "/tmp");
......
......@@ -75,8 +75,8 @@ void taosSetSystemLocale(const char *inLocale, const char *inCharSet) {
char *locale = setlocale(LC_CTYPE, inLocale);
// default locale or user specified locale is not valid, abort launch
if (inLocale == NULL || strlen(inCharSet) == 0) {
printf("Invalid locale:%s, please set the valid locale in config file\n", inLocale);
if (inLocale == NULL || strlen(inLocale) == 0) {
//printf("Invalid locale:%s, please set the valid locale in config file\n", inLocale);
}
if (!taosValidateEncodec(inCharSet)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册