Some cleanup

This commit is contained in:
Maximilian Kueffner
2025-08-17 21:51:13 +02:00
parent 88cc7363c6
commit 5e06f767e9
7 changed files with 23 additions and 24 deletions
+5 -5
View File
@@ -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() {}
};
+5 -5
View File
@@ -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*
{
+5 -5
View File
@@ -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_;