mlc/loggable.h

29 lines
512 B
C
Raw Normal View History

2023-07-23 12:04:26 +00:00
#pragma once
#include <list>
#include <string>
class Loggable {
public:
enum Severity {
debug,
info,
minor,
major,
warning,
error,
fatal
};
typedef std::pair<Severity, std::string> Message;
Loggable(Severity severity);
~Loggable();
void log (Severity severity, const std::string& comment) const;
std::list<Message> getHistory() const;
private:
const Severity currentSeverity;
mutable std::list<Message> history;
};