MCPcopy Create free account
hub / github.com/android/ndk-samples / InitLogging

Function InitLogging

base/src/main/cpp/logging.cpp:148–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void InitLogging(const std::optional<std::string_view> default_tag,
149 std::optional<LogSeverity> log_level, LogFunction&& logger,
150 AbortFunction&& aborter) {
151 SetLogger(std::forward<LogFunction>(logger));
152 SetAborter(std::forward<AbortFunction>(aborter));
153
154 if (gInitialized) {
155 return;
156 }
157
158 gInitialized = true;
159
160 if (default_tag.has_value()) {
161 SetDefaultTag(default_tag.value());
162 }
163
164 const char* tags = getenv("ANDROID_LOG_TAGS");
165 if (tags == nullptr) {
166 return;
167 }
168
169 if (log_level.has_value()) {
170 SetMinimumLogSeverity(log_level.value());
171 }
172}
173
174LogFunction SetLogger(LogFunction&& logger) {
175 LogFunction old_logger = std::move(Logger());

Callers

nothing calls this directly

Calls 5

SetLoggerFunction · 0.85
SetAborterFunction · 0.85
SetDefaultTagFunction · 0.85
SetMinimumLogSeverityFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected