34 lines
476 B
C++
34 lines
476 B
C++
/*
|
|
* utility_logger.cpp
|
|
*
|
|
* Created on: Mar 13, 2021
|
|
* Author: erki
|
|
*/
|
|
|
|
#include "utility_itmlogger.hpp"
|
|
|
|
#include <cstdarg>
|
|
#include <cstdio>
|
|
|
|
#include "main.h"
|
|
|
|
namespace Utility
|
|
{
|
|
|
|
void ITMLogger::log(const char* format, ...)
|
|
{
|
|
std::va_list args;
|
|
va_start(args, format);
|
|
|
|
const std::int32_t len = vsnprintf(_buffer.data(), _buffer.size(), format, args);
|
|
|
|
for (std::int32_t i = 0; i < len; i++)
|
|
{
|
|
ITM_SendChar(_buffer[i]);
|
|
}
|
|
|
|
va_end(args);
|
|
}
|
|
|
|
}
|