Here we put logging that needs to be thread safe We either push it on the logger thread, or from the main thread if threads aren't supported (e.g. html5)
| 335 | // Here we put logging that needs to be thread safe |
| 336 | // We either push it on the logger thread, or from the main thread if threads aren't supported (e.g. html5) |
| 337 | static void DoLogSynchronized(LogSeverity severity, const char* domain, const char* output, int output_len) |
| 338 | { |
| 339 | DM_SPINLOCK_SCOPED_LOCK(g_ListenerLock); // Make sure no listeners are added or removed during the scope |
| 340 | |
| 341 | int count = dmAtomicGet32(&dmLog::g_ListenersCount); |
| 342 | for (int i = count - 1; i >= 0 ; --i) |
| 343 | { |
| 344 | g_Listeners[i]((LogSeverity)severity, domain, output); |
| 345 | } |
| 346 | |
| 347 | ProfileLogText("%s", output); |
| 348 | } |
| 349 | |
| 350 | static void dmLogDispatch(dmMessage::Message *message, void* user_ptr) |
| 351 | { |
no test coverage detected