HiveMind
Logger.h
Go to the documentation of this file.
1 #ifndef __LOGGER_H_
2 #define __LOGGER_H_
3 
4 #include "logger/ILogger.h"
5 #include <bsp/IUserInterface.h>
6 
7 #include <Mutex.h>
8 
9 class Logger : public ILogger {
10  public:
11  Logger(LogLevel level, IUserInterface& ui);
12  ~Logger() override = default;
13 
14  LogRet log(LogLevel level, const char* format, ...) override;
15  LogRet log(LogLevel level, const char* format, va_list args) override;
16 
17  private:
18  static char logLevelToString(LogLevel logLevel);
19 
22 };
23 
24 #endif // __LOGGER_H_
LogRet
LogRet
The return value of the logger.
Definition: ILogger.h:23
Logger::~Logger
~Logger() override=default
Logger::m_ui
IUserInterface & m_ui
Definition: Logger.h:20
Logger::logLevelToString
static char logLevelToString(LogLevel logLevel)
Definition: Logger.cpp:31
LogLevel
LogLevel
The log level used for the logger.
Definition: ILogger.h:9
Logger::log
LogRet log(LogLevel level, const char *format,...) override
Logs if the provided level is higher than the current log level (Thread-safe)
Definition: Logger.cpp:8
IUserInterface.h
ILogger
A logger class with basic logging capabilities.
Definition: ILogger.h:35
Logger::m_logLevel
LogLevel m_logLevel
Definition: Logger.h:21
Logger
Definition: Logger.h:9
IUserInterface
Manages the user interface The user interface can consist of buttons, LED, serial print ports,...
Definition: IUserInterface.h:36
Logger::Logger
Logger(LogLevel level, IUserInterface &ui)
Definition: Logger.cpp:6
ILogger.h