MCPcopy Create free account
hub / github.com/apache/arrow / GetLogger

Method GetLogger

cpp/src/arrow/util/logger.cc:102–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102std::shared_ptr<Logger> LoggerRegistry::GetLogger(std::string_view name) {
103 if (name.empty()) {
104 return GetDefaultLogger();
105 }
106
107 auto registry = GetRegistry();
108 {
109 std::lock_guard<std::mutex> lk(registry->mtx);
110 const auto& loggers = registry->loggers;
111 if (auto it = loggers.find(std::string(name)); it != loggers.end()) {
112 return it->second;
113 }
114 }
115 return std::make_shared<NoopLogger>();
116}
117
118std::shared_ptr<Logger> LoggerRegistry::GetDefaultLogger() {
119 auto registry = GetRegistry();

Callers 1

MakeLoggerMethod · 0.80

Calls 4

GetRegistryFunction · 0.85
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected