adjust log
This commit is contained in:
parent
f8adfac414
commit
927a2eea7f
|
@ -277,12 +277,16 @@ bool taosCfgDynamicOptions(char *msg) {
|
||||||
for (int32_t i = 0; i < tsGlobalConfigNum; ++i) {
|
for (int32_t i = 0; i < tsGlobalConfigNum; ++i) {
|
||||||
SGlobalCfg *cfg = tsGlobalConfig + i;
|
SGlobalCfg *cfg = tsGlobalConfig + i;
|
||||||
//if (!(cfg->cfgType & TSDB_CFG_CTYPE_B_LOG)) continue;
|
//if (!(cfg->cfgType & TSDB_CFG_CTYPE_B_LOG)) continue;
|
||||||
if (cfg->valType != TAOS_CFG_VTYPE_INT32) continue;
|
if (cfg->valType != TAOS_CFG_VTYPE_INT32 && cfg->valType != TAOS_CFG_VTYPE_INT8) continue;
|
||||||
|
|
||||||
int32_t cfgLen = (int32_t)strlen(cfg->option);
|
int32_t cfgLen = (int32_t)strlen(cfg->option);
|
||||||
if (cfgLen != olen) continue;
|
if (cfgLen != olen) continue;
|
||||||
if (strncasecmp(option, cfg->option, olen) != 0) continue;
|
if (strncasecmp(option, cfg->option, olen) != 0) continue;
|
||||||
*((int32_t *)cfg->ptr) = vint;
|
if (cfg->valType != TAOS_CFG_VTYPE_INT32) {
|
||||||
|
*((int32_t *)cfg->ptr) = vint;
|
||||||
|
} else {
|
||||||
|
*((int8_t *)cfg->ptr) = (int8_t)vint;
|
||||||
|
}
|
||||||
|
|
||||||
if (strncasecmp(cfg->option, "monitor", olen) == 0) {
|
if (strncasecmp(cfg->option, "monitor", olen) == 0) {
|
||||||
if (1 == vint) {
|
if (1 == vint) {
|
||||||
|
|
|
@ -1044,6 +1044,11 @@ static int32_t mnodeRetrieveConfigs(SShowObj *pShow, char *data, int32_t rows, v
|
||||||
|
|
||||||
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows;
|
||||||
switch (cfg->valType) {
|
switch (cfg->valType) {
|
||||||
|
case TAOS_CFG_VTYPE_INT8:
|
||||||
|
t = snprintf(varDataVal(pWrite), TSDB_CFG_VALUE_LEN, "%d", *((int8_t *)cfg->ptr));
|
||||||
|
varDataSetLen(pWrite, t);
|
||||||
|
numOfRows++;
|
||||||
|
break;
|
||||||
case TAOS_CFG_VTYPE_INT16:
|
case TAOS_CFG_VTYPE_INT16:
|
||||||
t = snprintf(varDataVal(pWrite), TSDB_CFG_VALUE_LEN, "%d", *((int16_t *)cfg->ptr));
|
t = snprintf(varDataVal(pWrite), TSDB_CFG_VALUE_LEN, "%d", *((int16_t *)cfg->ptr));
|
||||||
varDataSetLen(pWrite, t);
|
varDataSetLen(pWrite, t);
|
||||||
|
|
|
@ -396,6 +396,9 @@ void taosPrintGlobalCfg() {
|
||||||
blank[blankLen] = 0;
|
blank[blankLen] = 0;
|
||||||
|
|
||||||
switch (cfg->valType) {
|
switch (cfg->valType) {
|
||||||
|
case TAOS_CFG_VTYPE_INT8:
|
||||||
|
uInfo(" %s:%s%d%s", cfg->option, blank, *((int8_t *)cfg->ptr), tsGlobalUnit[cfg->unitType]);
|
||||||
|
break;
|
||||||
case TAOS_CFG_VTYPE_INT16:
|
case TAOS_CFG_VTYPE_INT16:
|
||||||
uInfo(" %s:%s%d%s", cfg->option, blank, *((int16_t *)cfg->ptr), tsGlobalUnit[cfg->unitType]);
|
uInfo(" %s:%s%d%s", cfg->option, blank, *((int16_t *)cfg->ptr), tsGlobalUnit[cfg->unitType]);
|
||||||
break;
|
break;
|
||||||
|
@ -428,6 +431,9 @@ static void taosDumpCfg(SGlobalCfg *cfg) {
|
||||||
blank[blankLen] = 0;
|
blank[blankLen] = 0;
|
||||||
|
|
||||||
switch (cfg->valType) {
|
switch (cfg->valType) {
|
||||||
|
case TAOS_CFG_VTYPE_INT8:
|
||||||
|
printf(" %s:%s%d%s\n", cfg->option, blank, *((int8_t *)cfg->ptr), tsGlobalUnit[cfg->unitType]);
|
||||||
|
break;
|
||||||
case TAOS_CFG_VTYPE_INT16:
|
case TAOS_CFG_VTYPE_INT16:
|
||||||
printf(" %s:%s%d%s\n", cfg->option, blank, *((int16_t *)cfg->ptr), tsGlobalUnit[cfg->unitType]);
|
printf(" %s:%s%d%s\n", cfg->option, blank, *((int16_t *)cfg->ptr), tsGlobalUnit[cfg->unitType]);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue