2023-09-18 18:59:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "loggger.h"
|
|
|
|
|
|
|
|
class Loggable {
|
|
|
|
public:
|
|
|
|
explicit Loggable(const std::shared_ptr<Logger>& logger);
|
|
|
|
virtual ~Loggable() = default;
|
|
|
|
|
|
|
|
void debug(const std::string& message) const;
|
|
|
|
void info(const std::string& message) const;
|
|
|
|
void minor(const std::string& message) const;
|
|
|
|
void major(const std::string& message) const;
|
|
|
|
void warn(const std::string& message) const;
|
|
|
|
void error(const std::string& message) const;
|
|
|
|
void fatal(const std::string& message) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void log(Logger::Severity severity, const std::string& message) const;
|
|
|
|
|
2023-09-25 20:15:24 +00:00
|
|
|
protected:
|
2023-09-18 18:59:43 +00:00
|
|
|
std::shared_ptr<Logger> logger;
|
|
|
|
};
|