未验证 提交 c0fc41f7 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #18798 from taosdata/enh/TD-21071

enh: print dnode startup parameters
......@@ -62,6 +62,7 @@ int32_t taosRealPath(char *dirname, char *realPath, int32_t maxlen);
bool taosIsDir(const char *dirname);
char *taosDirName(char *dirname);
char *taosDirEntryBaseName(char *dirname);
void taosGetCwd(char *buf, int32_t len);
TdDirPtr taosOpenDir(const char *dirname);
TdDirEntryPtr taosReadDir(TdDirPtr pDir);
......
......@@ -62,8 +62,11 @@ void taosResetTerminalMode();
taosMemoryFree(strings); \
}
#else
#define taosPrintTrace(flags, level, dflag) \
{}
#define taosPrintTrace(flags, level, dflag) \
{ \
taosPrintLog(flags, level, dflag, \
"backtrace not implemented on windows, so detailed stack information cannot be printed"); \
}
#endif
#ifdef __cplusplus
......
......@@ -127,6 +127,19 @@ static int32_t dmParseArgs(int32_t argc, char const *argv[]) {
return 0;
}
static void dmPrintArgs(int32_t argc, char const *argv[]) {
char path[1024] = {0};
taosGetCwd(path, sizeof(path));
char args[1024] = {0};
int32_t arglen = snprintf(args, sizeof(args), "%s", argv[0]);
for (int32_t i = 1; i < argc; ++i) {
arglen = arglen + snprintf(args + arglen, sizeof(args) - arglen, " %s", argv[i]);
}
dInfo("startup path:%s args:%s", path, args);
}
static void dmGenerateGrant() { mndGenerateMachineCode(); }
static void dmPrintVersion() {
......@@ -216,6 +229,8 @@ int mainWindows(int argc, char **argv) {
return -1;
}
dmPrintArgs(argc, argv);
if (taosInitCfg(configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0) != 0) {
dError("failed to start since read config error");
taosCloseLog();
......
......@@ -497,3 +497,11 @@ int32_t taosCloseDir(TdDirPtr *ppDir) {
return 0;
#endif
}
void taosGetCwd(char *buf, int32_t len) {
#if !defined(WINDOWS)
(void)getcwd(buf, len - 1);
#else
strncpy(buf, "not implemented on windows", len -1);
#endif
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册