SHA256
modify something
This commit is contained in:
@@ -42,7 +42,7 @@ namespace flog {
|
|||||||
private:
|
private:
|
||||||
LogManager() noexcept = default;
|
LogManager() noexcept = default;
|
||||||
|
|
||||||
void FLOG_CALL print_log(const LogMessage &message) const;
|
void FLOG_CALL write_log(const LogMessage &message) const;
|
||||||
|
|
||||||
std::atomic<LogLevel> m_minLogLevel{LogLevel::DEBUG};
|
std::atomic<LogLevel> m_minLogLevel{LogLevel::DEBUG};
|
||||||
|
|
||||||
|
|||||||
@@ -10,19 +10,20 @@
|
|||||||
namespace flog {
|
namespace flog {
|
||||||
class FLOG_API LogOutputter {
|
class FLOG_API LogOutputter {
|
||||||
public:
|
public:
|
||||||
explicit LogOutputter(std::string name) noexcept : name(std::move(name)) {}
|
explicit LogOutputter(std::string name, std::unique_ptr<LogFormatter> formatter) noexcept
|
||||||
|
: m_name(std::move(name)), m_logFormatter(std::move(formatter)) {}
|
||||||
|
|
||||||
virtual ~LogOutputter() = default;
|
virtual ~LogOutputter() = default;
|
||||||
|
|
||||||
std::string& FLOG_CALL getName() const noexcept;
|
_NODISCARD std::string FLOG_CALL getName() const noexcept { return m_name; }
|
||||||
|
|
||||||
std::unique_ptr<LogFormatter> FLOG_CALL set_formatter(const std::unique_ptr<LogFormatter> &formatter);
|
std::unique_ptr<LogFormatter> FLOG_CALL set_formatter(const std::unique_ptr<LogFormatter> &formatter);
|
||||||
[[nodiscard]] const std::unique_ptr<LogFormatter> & FLOG_CALL get_formatter() const;
|
_NODISCARD const std::unique_ptr<LogFormatter> & FLOG_CALL get_formatter() const;
|
||||||
|
|
||||||
virtual void FLOG_CALL write(const LogMessage &message) = 0;
|
virtual void FLOG_CALL write_log(const LogMessage &message) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::string name;
|
std::string m_name;
|
||||||
|
|
||||||
std::unique_ptr<LogFormatter> m_logFormatter;
|
std::unique_ptr<LogFormatter> m_logFormatter;
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-2
@@ -78,10 +78,10 @@ namespace flog {
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogManager::print_log(const LogMessage &message) const {
|
void LogManager::write_log(const LogMessage &message) const {
|
||||||
std::shared_lock lock(m_logOutputtersMutex);
|
std::shared_lock lock(m_logOutputtersMutex);
|
||||||
for (const std::unique_ptr<LogOutputter> &outputter: m_logOutputters | std::views::values) {
|
for (const std::unique_ptr<LogOutputter> &outputter: m_logOutputters | std::views::values) {
|
||||||
outputter->write(message);
|
outputter->write_log(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
#include <featherlog/log_outputter.hpp>
|
|
||||||
|
|
||||||
namespace flog {
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user