MCPcopy Create free account
hub / github.com/comaps/comaps / ValidateLogAbortLevel

Function ValidateLogAbortLevel

dev_sandbox/main.cpp:64–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62namespace
63{
64bool ValidateLogAbortLevel(char const * flagname, std::string const & value)
65{
66 if (auto level = base::FromString(value); !level)
67 {
68 std::cerr << "Invalid value for --" << flagname << ": " << value << ", must be one of: ";
69 auto const & names = base::GetLogLevelNames();
70 for (size_t i = 0; i < names.size(); ++i)
71 {
72 if (i != 0)
73 std::cerr << ", ";
74 std::cerr << names[i];
75 }
76 std::cerr << '\n';
77 return false;
78 }
79 return true;
80}
81
82bool const g_logAbortLevelDummy = gflags::RegisterFlagValidator(&FLAGS_log_abort_level, &ValidateLogAbortLevel);
83

Callers

nothing calls this directly

Calls 2

FromStringFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected