Log something
| 102 | |
| 103 | // Log something |
| 104 | void DefaultLogger::log(Level level, const std::string& physicsWorldName, Category category, const std::string& message, const char* filename, int lineNumber) { |
| 105 | |
| 106 | // Get current time |
| 107 | auto now = std::chrono::system_clock::now(); |
| 108 | auto time = std::chrono::system_clock::to_time_t(now); |
| 109 | |
| 110 | mMutex.lock(); |
| 111 | |
| 112 | // For each destination |
| 113 | for (auto it = mDestinations.begin(); it != mDestinations.end(); ++it) { |
| 114 | |
| 115 | (*it)->write(time, physicsWorldName, message, level, category, filename, lineNumber); |
| 116 | } |
| 117 | |
| 118 | mMutex.unlock(); |
| 119 | } |