Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

available options for log level is not correct. #12517

Closed
qiaoxinke opened this issue Feb 16, 2023 · 1 comment · Fixed by #12537
Closed

available options for log level is not correct. #12517

qiaoxinke opened this issue Feb 16, 2023 · 1 comment · Fixed by #12537
Assignees
Labels
area/bigdata Indicates that the Issue or PR belongs to the area of TiFlash, TiSpark, and OLAP. tracked This issue has been tracked.

Comments

@qiaoxinke
Copy link

File: /release-6.5/tiflash/tiflash-configuration.md

for the following settings of tiflash.toml. the available options is not correct. such as if I config the level to 「information」, it reported a error. the correct value should be "info" with double quotation.

[logger]
## log level (available options: trace, debug, information, warning, error). The default value is debug.
level = debug

@Oreoxmt Oreoxmt added the area/engine Indicates that the Issue or PR belongs to the area of TP storage or Cloud storage. label Feb 16, 2023
@Oreoxmt
Copy link
Collaborator

Oreoxmt commented Feb 16, 2023

@hongyunyan Could you please help confirm the value options of logger.level?

It seems that log_level can accept both "info" and "information" as an input and the normalize() function will convert "info" to "information" internally.

https://github.com/pingcap/tiflash/blob/5e205105f52048934d18ccace1b70a86a0ed08a5/libs/libdaemon/src/BaseDaemon.cpp#L762

https://github.com/pingcap/tiflash/blob/5e205105f52048934d18ccace1b70a86a0ed08a5/libs/libdaemon/src/BaseDaemon.cpp#L681-L693

auto log_level = normalize(config.getString("logger.level", "debug"));
...
static std::string normalize(const std::string & log_level)
{
    std::string norm = Poco::toLower(log_level);
    // normalize
    // info -> information
    // warn -> warning
    if (norm == "info")
        return "information";
    else if (norm == "warn")
        return "warning";
    else
        return norm;
}

@Oreoxmt Oreoxmt added type/bug-fix Fixes typos, wrong format, or other wrong or inaccurate document content. and removed area/engine Indicates that the Issue or PR belongs to the area of TP storage or Cloud storage. labels Feb 16, 2023
@Oreoxmt Oreoxmt self-assigned this Feb 16, 2023
@Oreoxmt Oreoxmt added area/bigdata Indicates that the Issue or PR belongs to the area of TiFlash, TiSpark, and OLAP. and removed type/bug-fix Fixes typos, wrong format, or other wrong or inaccurate document content. labels Feb 16, 2023
@Oreoxmt Oreoxmt added the tracked This issue has been tracked. label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bigdata Indicates that the Issue or PR belongs to the area of TiFlash, TiSpark, and OLAP. tracked This issue has been tracked.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants