12 #include <common/include/WindowsWrapper.hpp> 15 #if defined(__ANDROID__) 16 #include <android/log.h> 24 template<LogSeverity Level>
106 class StandardOutputColourSink :
public LogSink 114 void Consume(
const std::string& s)
override 116 std::cout << GetColour(m_Level) << s << ResetColour() << std::endl;
120 std::string ResetColour()
140 return "\033[41;30m";
149 class DebugOutputSink :
public LogSink 152 void Consume(
const std::string& s)
override 155 #if defined(_MSC_VER) 156 OutputDebugString(s.c_str());
157 OutputDebugString(
"\n");
158 #elif defined(__ANDROID__) 159 __android_log_write(ANDROID_LOG_DEBUG,
"armnn", s.c_str());
166 template<LogSeverity Level>
176 std::make_shared<StandardOutputColourSink>(Level));
180 std::make_shared<StandardOutputSink>());
187 std::make_shared<DebugOutputSink>());
193 SetLoggingSinks<LogSeverity::Trace>(standardOut, debugOut, coloured);
194 SetLoggingSinks<LogSeverity::Debug>(standardOut, debugOut, coloured);
195 SetLoggingSinks<LogSeverity::Info>(standardOut, debugOut, coloured);
196 SetLoggingSinks<LogSeverity::Warning>(standardOut, debugOut, coloured);
197 SetLoggingSinks<LogSeverity::Error>(standardOut, debugOut, coloured);
198 SetLoggingSinks<LogSeverity::Fatal>(standardOut, debugOut, coloured);
void SetAllLoggingSinks(bool standardOut, bool debugOut, bool coloured)
void Enable(bool enable=true)
static SimpleLogger & Get()
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)