1
0
forked from blue/mlc
mlc/loggable.cpp

19 lines
427 B
C++
Raw Normal View History

2023-07-23 12:04:26 +00:00
#include "loggable.h"
Loggable::Loggable(Loggable::Severity severity):
currentSeverity(severity),
history()
{}
Loggable::~Loggable()
{}
void Loggable::log(Loggable::Severity severity, const std::string& comment) const {
if (severity >= currentSeverity)
history.emplace_back(severity, comment);
}
std::list<std::pair<Loggable::Severity, std::string>> Loggable::getHistory() const {
return history;
}