| 206 | #endif |
| 207 | |
| 208 | void 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 | |
| 230 | void DefaultAborter(const char* abort_message) { |
| 231 | #ifdef __ANDROID__ |
nothing calls this directly
no test coverage detected