mirror of https://github.com/gabime/spdlog.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
644 B
C++
24 lines
644 B
C++
#include "stdafx.h"
|
|
#include "c11log/details/factory.h"
|
|
#include "c11log/logger.h"
|
|
|
|
c11log::details::factory::logger_ptr c11log::details::factory::get_logger(const std::string &name)
|
|
{
|
|
std::lock_guard<std::mutex> lock(_loggers_mutex);
|
|
auto found = _loggers.find(name);
|
|
if (found == _loggers.end()) {
|
|
auto new_logger_ptr = std::make_shared<c11log::logger>(name);
|
|
_loggers.insert(std::make_pair(name, new_logger_ptr));
|
|
return new_logger_ptr;
|
|
}
|
|
else {
|
|
return found->second;
|
|
}
|
|
}
|
|
|
|
c11log::details::factory & c11log::details::factory::instance()
|
|
{
|
|
static c11log::details::factory instance;
|
|
return instance;
|
|
}
|