fix: remove 'count' from logger level (#2408)

This commit is contained in:
Peter Chen
2025-08-11 07:00:52 -04:00
committed by GitHub
parent c95d8f2f89
commit 226d386be2
3 changed files with 4 additions and 5 deletions

View File

@@ -428,7 +428,7 @@ This document provides a list of all available Clio configuration properties in
- **Required**: False - **Required**: False
- **Type**: string - **Type**: string
- **Default value**: None - **Default value**: None
- **Constraints**: The value must be one of the following: `trace`, `debug`, `info`, `warning`, `error`, `fatal`, `count`. - **Constraints**: The value must be one of the following: `trace`, `debug`, `info`, `warning`, `error`, `fatal`.
- **Description**: The log level for the specific log channel. - **Description**: The log level for the specific log channel.
### log_level ### log_level
@@ -436,7 +436,7 @@ This document provides a list of all available Clio configuration properties in
- **Required**: True - **Required**: True
- **Type**: string - **Type**: string
- **Default value**: `info` - **Default value**: `info`
- **Constraints**: The value must be one of the following: `trace`, `debug`, `info`, `warning`, `error`, `fatal`, `count`. - **Constraints**: The value must be one of the following: `trace`, `debug`, `info`, `warning`, `error`, `fatal`.
- **Description**: The general logging level of Clio. This level is applied to all log channels that do not have an explicitly defined logging level. - **Description**: The general logging level of Clio. This level is applied to all log channels that do not have an explicitly defined logging level.
### log_format ### log_format

View File

@@ -45,14 +45,13 @@ class ConfigValue;
/** /**
* @brief specific values that are accepted for logger levels in config. * @brief specific values that are accepted for logger levels in config.
*/ */
static constexpr std::array<char const*, 7> kLOG_LEVELS = { static constexpr std::array<char const*, 6> kLOG_LEVELS = {
"trace", "trace",
"debug", "debug",
"info", "info",
"warning", "warning",
"error", "error",
"fatal", "fatal",
"count",
}; };
/** /**

View File

@@ -219,7 +219,7 @@ getMinSeverity(config::ClioConfigDefinition const& config, Severity defaultSever
for (auto it = overrides.begin<util::config::ObjectView>(); it != overrides.end<util::config::ObjectView>(); ++it) { for (auto it = overrides.begin<util::config::ObjectView>(); it != overrides.end<util::config::ObjectView>(); ++it) {
auto const& channelConfig = *it; auto const& channelConfig = *it;
auto const name = channelConfig.get<std::string>("channel"); auto const name = channelConfig.get<std::string>("channel");
if (std::ranges::count(Logger::kCHANNELS, name) == 0) { // TODO: use std::ranges::contains when available if (not std::ranges::contains(Logger::kCHANNELS, name)) {
return std::unexpected{fmt::format("Can't override settings for log channel {}: invalid channel", name)}; return std::unexpected{fmt::format("Can't override settings for log channel {}: invalid channel", name)};
} }