MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / warningSettingNotFound

Method warningSettingNotFound

src/Core/BaseSettings.cpp:59–83  ·  view source on GitHub ↗

Log the summary of unknown settings as a warning instead of warning for each one separately.

Source from the content-addressed store, hash-verified

57
58/// Log the summary of unknown settings as a warning instead of warning for each one separately.
59void BaseSettingsHelpers::warningSettingNotFound(std::string_view name)
60{
61 unknown_settings.push_back(fmt::format("`{}`", name));
62
63 if (!unknown_settings_warning_logged)
64 {
65 static size_t MAX_UNKNOWN_SETTINGS_FOR_LOGGING = 3;
66
67 if (unknown_settings.size() > MAX_UNKNOWN_SETTINGS_FOR_LOGGING)
68 {
69 Strings first_few(unknown_settings.begin(), unknown_settings.begin() + MAX_UNKNOWN_SETTINGS_FOR_LOGGING);
70 LOG_WARNING(
71 getLogger("Settings"),
72 "Unknown settings: {} and {} more, skipping",
73 fmt::join(first_few, ", "),
74 unknown_settings.size() - MAX_UNKNOWN_SETTINGS_FOR_LOGGING);
75 }
76 else
77 {
78 LOG_WARNING(getLogger("Settings"), "Unknown settings: {}, skipping", fmt::join(unknown_settings, ", "));
79 }
80
81 unknown_settings_warning_logged = true;
82 }
83}
84
85void BaseSettingsHelpers::flushWarnings()
86{

Callers

nothing calls this directly

Calls 5

getLoggerFunction · 0.70
formatFunction · 0.50
push_backMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected