Skip to content

Commit

Permalink
don't spam logs with default config values (#314)
Browse files Browse the repository at this point in the history
Co-authored-by: briaguya <briaguya@alice>
  • Loading branch information
briaguya-ai and briaguya committed Jun 16, 2023
1 parent 04ef63c commit 7d60dd3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ std::string Config::GetString(const std::string& key, const std::string& default
if (n.is_string() && !n.get<std::string>().empty()) {
return n;
}
SPDLOG_TRACE("Failed to retrieve string with key ({}) from config. Returning default value ({})", key,
defaultValue);

return defaultValue;
}

Expand All @@ -72,7 +71,7 @@ float Config::GetFloat(const std::string& key, float defaultValue) {
if (n.is_number_float()) {
return n;
}
SPDLOG_TRACE("Failed to retrieve float with key ({}) from config. Returning default value ({})", key, defaultValue);

return defaultValue;
}

Expand All @@ -81,7 +80,7 @@ bool Config::GetBool(const std::string& key, bool defaultValue) {
if (n.is_boolean()) {
return n;
}
SPDLOG_TRACE("Failed to retrieve bool with key ({}) from config. Returning default value ({})", key, defaultValue);

return defaultValue;
}

Expand All @@ -90,7 +89,7 @@ int32_t Config::GetInt(const std::string& key, int32_t defaultValue) {
if (n.is_number_integer()) {
return n;
}
SPDLOG_TRACE("Failed to retrieve int with key ({}) from config. Returning default value ({})", key, defaultValue);

return defaultValue;
}

Expand All @@ -99,7 +98,7 @@ uint32_t Config::GetUInt(const std::string& key, uint32_t defaultValue) {
if (n.is_number_unsigned()) {
return n;
}
SPDLOG_TRACE("Failed to retrieve uint with key ({}) from config. Returning default value ({})", key, defaultValue);

return defaultValue;
}

Expand Down

0 comments on commit 7d60dd3

Please sign in to comment.