MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / log_level_from_name

Function log_level_from_name

tests/framework/Exceptions.cpp:36–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34namespace framework
35{
36LogLevel log_level_from_name(const std::string &name)
37{
38 static const std::map<std::string, LogLevel> levels = {
39 {"none", LogLevel::NONE},
40 {"config", LogLevel::CONFIG},
41 {"tests", LogLevel::TESTS},
42 {"errors", LogLevel::ERRORS},
43 {"warnings", LogLevel::WARNINGS},
44 {"debug", LogLevel::DEBUG},
45 {"measurements", LogLevel::MEASUREMENTS},
46 {"all", LogLevel::ALL},
47 };
48
49 try
50 {
51 return levels.at(tolower(name));
52 }
53 catch (const std::out_of_range &)
54 {
55 throw std::invalid_argument(name);
56 }
57}
58
59::std::istream &operator>>(::std::istream &stream, LogLevel &level)
60{

Callers 1

Exceptions.cppFile · 0.85

Calls 1

tolowerFunction · 0.70

Tested by

no test coverage detected