SHA256
.
This commit is contained in:
+6
-13
@@ -6,17 +6,6 @@ namespace flog {
|
||||
return std::shared_ptr<LogManager>(new LogManager());
|
||||
}
|
||||
|
||||
LogManager::~LogManager() {
|
||||
{
|
||||
std::lock_guard lock(m_loggersMutex);
|
||||
m_loggers.clear();
|
||||
}
|
||||
{
|
||||
std::lock_guard lock(m_logOutputtersMutex);
|
||||
m_logOutputters.clear();
|
||||
}
|
||||
}
|
||||
|
||||
LogLevel LogManager::get_min_log_level() const noexcept {
|
||||
return m_minLogLevel.load(std::memory_order_relaxed);
|
||||
}
|
||||
@@ -25,9 +14,13 @@ namespace flog {
|
||||
m_minLogLevel.store(level, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
void LogManager::add_outputter(std::unique_ptr<LogOutputter> outputter) {
|
||||
bool LogManager::add_outputter(const std::string& name, std::unique_ptr<LogOutputter> outputter) {
|
||||
std::lock_guard lock(m_logOutputtersMutex);
|
||||
m_logOutputters.push_back(std::move(outputter));
|
||||
if (m_logOutputters.contains(name)) {
|
||||
return false;
|
||||
}
|
||||
m_logOutputters[name] = std::move(outputter);
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<Logger> LogManager::get_logger(const std::string &name) {
|
||||
|
||||
Reference in New Issue
Block a user