46 std::transform(level.begin(), level.end(), level.begin(),
47 [](
unsigned char c){ return std::tolower(c); }
54 else if (level ==
"debug")
58 else if (level ==
"info")
62 else if (level ==
"warning")
66 else if (level ==
"error")
70 else if (level ==
"fatal")
77 "'. Valid options: trace, debug, info, warning, error, fatal");
86 virtual void Consume(
const std::string&) = 0;
94 void Consume(
const std::string& s)
override
96 std::cout << s << std::endl;
116 for (
auto sink : m_LogSinks)
120 sink->Consume(m_Os.str());
131 : m_LogSinks(other.m_LogSinks)
132 , m_Os(
std::move(other.m_Os))
133 , m_Enabled(other.m_Enabled)
137 other.m_Enabled =
false;
140 template<
typename Streamable>
151 const std::vector<std::shared_ptr<LogSink>>& m_LogSinks;
152 std::ostringstream m_Os;
156 template<LogSeverity Level>
161 : m_Sinks{std::make_shared<StandardOutputSink>()}
185 m_Sinks.push_back(sink);
188 std::vector<std::shared_ptr<LogSink>> m_Sinks;
212 #define ARMNN_LOG(severity) \
213 armnn::SimpleLogger<ConvertLogSeverity(armnn::BoostLogSeverityMapping::severity)>::Get().StartNewRecord()