12 #include <common/include/WindowsWrapper.hpp> 15 #if defined(__ANDROID__) 16 #include <android/log.h> 57 class StandardOutputColourSink :
public LogSink 65 void Consume(
const std::string& s)
override 67 std::cout << GetColour(m_Level) << s << ResetColour() << std::endl;
71 std::string ResetColour()
100 class DebugOutputSink :
public LogSink 103 void Consume(
const std::string& s)
override 106 #if defined(_MSC_VER) 107 OutputDebugString(s.c_str());
108 OutputDebugString(
"\n");
109 #elif defined(__ANDROID__) 110 __android_log_write(ANDROID_LOG_DEBUG,
"armnn", s.c_str());
117 template<LogSeverity Level>
127 std::make_shared<StandardOutputColourSink>(Level));
131 std::make_shared<StandardOutputSink>());
138 std::make_shared<DebugOutputSink>());
144 SetLoggingSinks<LogSeverity::Trace>(standardOut, debugOut, coloured);
145 SetLoggingSinks<LogSeverity::Debug>(standardOut, debugOut, coloured);
146 SetLoggingSinks<LogSeverity::Info>(standardOut, debugOut, coloured);
147 SetLoggingSinks<LogSeverity::Warning>(standardOut, debugOut, coloured);
148 SetLoggingSinks<LogSeverity::Error>(standardOut, debugOut, coloured);
149 SetLoggingSinks<LogSeverity::Fatal>(standardOut, debugOut, coloured);
static SimpleLogger & Get()
void SetAllLoggingSinks(bool standardOut, bool debugOut, bool coloured)
void Enable(bool enable=true)
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
void SetLogFilter(LogSeverity level)
#define ARMNN_FALLTHROUGH
#define ARMNN_ASSERT(COND)
void AddSink(std::shared_ptr< LogSink > sink)
void SetLoggingSinks(bool standardOut, bool debugOut, bool coloured)