Some cleanup
This commit is contained in:
@@ -14,11 +14,11 @@ enum class LogLevel
|
||||
class ILog
|
||||
{
|
||||
public:
|
||||
virtual void Info(const std::string& msg) = 0;
|
||||
virtual void Debug(const std::string& msg) = 0;
|
||||
virtual void Warn(const std::string& msg) = 0;
|
||||
virtual void Error(const std::string& msg) = 0;
|
||||
virtual void ChangeLevel(LogLevel lvl) = 0;
|
||||
virtual void Info(const std::string& msg) const = 0;
|
||||
virtual void Debug(const std::string& msg) const = 0;
|
||||
virtual void Warn(const std::string& msg) const = 0;
|
||||
virtual void Error(const std::string& msg) const = 0;
|
||||
virtual void ChangeLevel(LogLevel lvl) const = 0;
|
||||
|
||||
virtual ~ILog() {}
|
||||
};
|
||||
|
||||
@@ -19,12 +19,12 @@ SpdLogger::SpdLogger(const std::string& file_sink, const std::string& name)
|
||||
logger_->info("Logger initiated");
|
||||
}
|
||||
|
||||
void SpdLogger::Info(const std::string& msg) { this->logger_->info(msg); }
|
||||
void SpdLogger::Debug(const std::string& msg) { this->logger_->debug(msg); }
|
||||
void SpdLogger::Warn(const std::string& msg) { this->logger_->warn(msg); }
|
||||
void SpdLogger::Error(const std::string& msg) { this->logger_->error(msg); }
|
||||
void SpdLogger::Info(const std::string& msg) const { this->logger_->info(msg); }
|
||||
void SpdLogger::Debug(const std::string& msg) const { this->logger_->debug(msg); }
|
||||
void SpdLogger::Warn(const std::string& msg) const { this->logger_->warn(msg); }
|
||||
void SpdLogger::Error(const std::string& msg) const { this->logger_->error(msg); }
|
||||
|
||||
void SpdLogger::ChangeLevel(LogLevel lvl)
|
||||
void SpdLogger::ChangeLevel(LogLevel lvl) const
|
||||
{
|
||||
constexpr auto LogLevelToString = [](LogLevel l) -> const char*
|
||||
{
|
||||
|
||||
@@ -13,11 +13,11 @@ class SpdLogger : public ILog
|
||||
public:
|
||||
explicit SpdLogger(const std::string& file_sink, const std::string& name);
|
||||
|
||||
void Info(const std::string& msg) override;
|
||||
void Debug(const std::string& msg) override;
|
||||
void Warn(const std::string& msg) override;
|
||||
void Error(const std::string& msg) override;
|
||||
void ChangeLevel(LogLevel lvl) override;
|
||||
void Info(const std::string& msg) const override;
|
||||
void Debug(const std::string& msg) const override;
|
||||
void Warn(const std::string& msg) const override;
|
||||
void Error(const std::string& msg) const override;
|
||||
void ChangeLevel(LogLevel lvl) const override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<spdlog::logger> logger_;
|
||||
|
||||
Reference in New Issue
Block a user