12 #define NOMINMAX // Prevent definition of min/max macros that interfere with std::min/max 15 #undef TIME_MS // Windows.h defines this but we don't need it and it interferes with our definition in Instrument.hpp 18 #if defined(__ANDROID__) 19 #include <android/log.h> 22 #include <boost/assert.hpp> 23 #include <boost/core/ignore_unused.hpp> 62 class StandardOutputColourSink :
public LogSink 70 void Consume(
const std::string& s)
override 72 std::cout << GetColour(m_Level) << s << ResetColour() << std::endl;
76 std::string ResetColour()
105 class DebugOutputSink :
public LogSink 108 void Consume(
const std::string& s)
override 110 boost::ignore_unused(s);
111 #if defined(_MSC_VER) 112 OutputDebugString(s.c_str());
113 OutputDebugString(
"\n");
114 #elif defined(__ANDROID__) 115 __android_log_write(ANDROID_LOG_DEBUG,
"armnn", s.c_str());
117 boost::ignore_unused(s);
122 template<LogSeverity Level>
132 std::make_shared<StandardOutputColourSink>(Level));
136 std::make_shared<StandardOutputSink>());
143 std::make_shared<DebugOutputSink>());
149 SetLoggingSinks<LogSeverity::Trace>(standardOut, debugOut, coloured);
150 SetLoggingSinks<LogSeverity::Debug>(standardOut, debugOut, coloured);
151 SetLoggingSinks<LogSeverity::Info>(standardOut, debugOut, coloured);
152 SetLoggingSinks<LogSeverity::Warning>(standardOut, debugOut, coloured);
153 SetLoggingSinks<LogSeverity::Error>(standardOut, debugOut, coloured);
154 SetLoggingSinks<LogSeverity::Fatal>(standardOut, debugOut, coloured);
void Enable(bool enable=true)
void AddSink(std::shared_ptr< LogSink > sink)
#define ARMNN_FALLTHROUGH
void SetLoggingSinks(bool standardOut, bool debugOut, bool coloured)
void SetLogFilter(LogSeverity level)
void SetAllLoggingSinks(bool standardOut, bool debugOut, bool coloured)
static SimpleLogger & Get()