enh: print dnode startup parameters
This commit is contained in:
parent
5b21a2394c
commit
1d34b7edf8
|
@ -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,12 @@ 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
|
||||
|
|
|
@ -105,6 +105,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() {
|
||||
|
@ -194,6 +207,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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue