| 34 | namespace framework |
| 35 | { |
| 36 | LogFormat log_format_from_name(const std::string &name) |
| 37 | { |
| 38 | static const std::map<std::string, LogFormat> formats = { |
| 39 | {"pretty", LogFormat::PRETTY}, |
| 40 | {"none", LogFormat::NONE}, |
| 41 | {"json", LogFormat::JSON}, |
| 42 | }; |
| 43 | |
| 44 | try |
| 45 | { |
| 46 | return formats.at(tolower(name)); |
| 47 | } |
| 48 | catch (const std::out_of_range &) |
| 49 | { |
| 50 | throw std::invalid_argument(name); |
| 51 | } |
| 52 | } |
| 53 | } // namespace framework |
| 54 | } // namespace test |
| 55 | } // namespace arm_compute |