mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-14 17:52:05 +08:00
Small clean in registry impl
This commit is contained in:
parent
ca7c846089
commit
8a4f3b1ba7
@ -12,13 +12,10 @@
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include "spdlog/sinks/wincolor_sink.h"
|
#include "spdlog/sinks/wincolor_sink.h"
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include "spdlog/sinks/ansicolor_sink.h"
|
#include "spdlog/sinks/ansicolor_sink.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif // SPDLOG_DISABLE_DEFAULT_LOGGER
|
#endif // SPDLOG_DISABLE_DEFAULT_LOGGER
|
||||||
|
|
||||||
#include <functional>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
@ -79,7 +76,7 @@ namespace spdlog {
|
|||||||
std::shared_ptr<logger> registry::get(std::string_view logger_name) {
|
std::shared_ptr<logger> registry::get(std::string_view logger_name) {
|
||||||
std::lock_guard<std::mutex> lock(logger_map_mutex_);
|
std::lock_guard<std::mutex> lock(logger_map_mutex_);
|
||||||
for (const auto &[key, val]: loggers_) {
|
for (const auto &[key, val]: loggers_) {
|
||||||
if (key == logger_name) {
|
if (logger_name == key) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user