MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / StderrLogger

Function StderrLogger

Bcore/src/main/cpp/android-base/logging.cpp:208–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206#endif
207
208void StderrLogger(LogId, LogSeverity severity, const char* tag, const char* file, unsigned int line,
209 const char* message) {
210 struct tm now;
211 time_t t = time(nullptr);
212
213#if defined(_WIN32)
214 localtime_s(&now, &t);
215#else
216 localtime_r(&t, &now);
217#endif
218
219 char timestamp[32];
220 strftime(timestamp, sizeof(timestamp), "%m-%d %H:%M:%S", &now);
221
222 static const char log_characters[] = "VDIWEFF";
223 static_assert(arraysize(log_characters) - 1 == FATAL + 1,
224 "Mismatch in size of log_characters and values in LogSeverity");
225 char severity_char = log_characters[severity];
226 fprintf(stderr, "%s %c %s %5d %5d %s:%u] %s\n", tag ? tag : "nullptr", severity_char, timestamp,
227 getpid(), GetThreadId(), file, line, message);
228}
229
230void DefaultAborter(const char* abort_message) {
231#ifdef __ANDROID__

Callers

nothing calls this directly

Calls 1

GetThreadIdFunction · 0.85

Tested by

no test coverage detected