MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / log

Method log

testbed/src/TestbedLogger.cpp:55–76  ·  view source on GitHub ↗

Log something

Source from the content-addressed store, hash-verified

53
54// Log something
55void TestbedLogger::log(Level level, const std::string& physicsWorldName, Category category, const std::string& message, const char* filename, int lineNumber) {
56
57 // Get current time
58 auto now = std::chrono::system_clock::now();
59 auto time = std::chrono::system_clock::to_time_t(now);
60
61 // Get the destination file for this world
62 DefaultLogger::Destination* destination = mMapWorldToDestinations[physicsWorldName];
63
64 if (destination != nullptr) {
65
66 mMutex.lock();
67
68 // Write the log file into the file of the corresponding scene
69 destination->write(time, physicsWorldName, message, level, category, filename, lineNumber);
70
71 // Write the log into the standard output
72 mStandardOutputDestination->write(time, physicsWorldName, message, level, category, filename, lineNumber);
73
74 mMutex.unlock();
75 }
76}
77
78// Return the corresponding format
79DefaultLogger::Formatter* TestbedLogger::getFormatter(DefaultLogger::Format format) const {

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected