MCPcopy Create free account
hub / github.com/ElementsProject/elements / SetLoggingCategories

Function SetLoggingCategories

src/init/common.cpp:98–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void SetLoggingCategories(const ArgsManager& args)
99{
100 if (args.IsArgSet("-debug")) {
101 // Special-case: if -debug=0/-nodebug is set, turn off debugging messages
102 const std::vector<std::string> categories = args.GetArgs("-debug");
103
104 if (std::none_of(categories.begin(), categories.end(),
105 [](std::string cat){return cat == "0" || cat == "none";})) {
106 for (const auto& cat : categories) {
107 if (!LogInstance().EnableCategory(cat)) {
108 InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debug", cat));
109 }
110 }
111 }
112 }
113
114 // Now remove the logging categories which were explicitly excluded
115 for (const std::string& cat : args.GetArgs("-debugexclude")) {
116 if (!LogInstance().DisableCategory(cat)) {
117 InitWarning(strprintf(_("Unsupported logging category %s=%s."), "-debugexclude", cat));
118 }
119 }
120}
121
122bool StartLogging(const ArgsManager& args)
123{

Callers 1

Calls 8

InitWarningFunction · 0.85
_Function · 0.85
IsArgSetMethod · 0.80
GetArgsMethod · 0.80
EnableCategoryMethod · 0.80
DisableCategoryMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected