| 146 | } |
| 147 | |
| 148 | void 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 | |
| 174 | LogFunction SetLogger(LogFunction&& logger) { |
| 175 | LogFunction old_logger = std::move(Logger()); |
nothing calls this directly
no test coverage detected