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> 61 class StandardOutputColourSink :
public LogSink 69 void Consume(
const std::string& s)
override 71 std::cout << GetColour(m_Level) << s << ResetColour() << std::endl;
75 std::string ResetColour()
104 class DebugOutputSink :
public LogSink 107 void Consume(
const std::string& s)
override 110 #if defined(_MSC_VER) 111 OutputDebugString(s.c_str());
112 OutputDebugString(
"\n");
113 #elif defined(__ANDROID__) 114 __android_log_write(ANDROID_LOG_DEBUG,
"armnn", s.c_str());
121 template<LogSeverity Level>
131 std::make_shared<StandardOutputColourSink>(Level));
135 std::make_shared<StandardOutputSink>());
142 std::make_shared<DebugOutputSink>());
148 SetLoggingSinks<LogSeverity::Trace>(standardOut, debugOut, coloured);
149 SetLoggingSinks<LogSeverity::Debug>(standardOut, debugOut, coloured);
150 SetLoggingSinks<LogSeverity::Info>(standardOut, debugOut, coloured);
151 SetLoggingSinks<LogSeverity::Warning>(standardOut, debugOut, coloured);
152 SetLoggingSinks<LogSeverity::Error>(standardOut, debugOut, coloured);
153 SetLoggingSinks<LogSeverity::Fatal>(standardOut, debugOut, coloured);
static SimpleLogger & Get()
void SetAllLoggingSinks(bool standardOut, bool debugOut, bool coloured)
void Enable(bool enable=true)
Copyright (c) 2020 ARM Limited.
void IgnoreUnused(Ts &&...)
void SetLogFilter(LogSeverity level)
#define ARMNN_FALLTHROUGH
void AddSink(std::shared_ptr< LogSink > sink)
void SetLoggingSinks(bool standardOut, bool debugOut, bool coloured)