MotorControlModuleSDFM_TMS3.../Projects/EFC_Application/UMLibrary/logging/ILoggable.hh

42 lines
923 B
C++

#ifndef LOGGING_ILOGGABLE_H_
#define LOGGING_ILOGGABLE_H_
#include "ILogger.hh"
namespace logging {
struct DummyLogger : ILogger {
void log_critical(const char *, std::size_t ) { }
void log_error(const char *, std::size_t ) { }
void log_information(const char *, std::size_t ) { }
};
// struct ExceptionalLogger : ILogger
// {
// void log_critical(const char*, size_t) { throw exceptional_record(base::hi_record_priority); }
// void log_error(const char*, size_t) { throw exceptional_record(base::medium_record_priority); }
// void log_information(const char*, size_t) { throw exceptional_record(base::low_record_priority); }
// };
struct ILoggable {
static DummyLogger dummy;
logging::ILogger * logger = &dummy;
virtual void add_logger( ILogger * new_logger ) {
logger = new_logger;
}
//virtual ~ILoggable() = default;
};
}
#endif //LOGGING_ILOGGABLE_H_