skullc-peripherals/Utility/Inc/utility_ilogger.hpp
Erki d945e7a799
Some checks failed
continuous-integration/drone/push Build is failing
Add basic logging framework with a global logger
2021-03-20 23:22:17 +02:00

50 lines
717 B
C++

/*
* utility_ringbuffer.hpp
*
* Created on: Mar 12, 2021
* Author: erki
*/
#ifndef SKULLC_UTILITY_ILOGGER_HPP_
#define SKULLC_UTILITY_ILOGGER_HPP_
#include <cstdint>
namespace Utility
{
class ILogger
{
public:
enum class LogLevel : std::uint8_t
{
LOG_DEBUG = 0,
LOG_INFO,
LOG_NOTICE,
LOG_WARNING,
LOG_ERROR,
LOG_FATAL
};
constexpr static const char* level_strs[] = {
"DEBUG",
"INFO",
"NOTICE",
"WARNING",
"ERROR",
"FATAL"
};
ILogger() = default;
ILogger(const ILogger&) = delete;
ILogger(ILogger&&) = delete;
virtual ~ILogger() = default;
virtual void log(const char* format, ...) = 0;
};
}
#endif //SKULLC_UTILITY_ILOGGER_HPP_