MCPcopy Create free account
hub / github.com/assimp/assimp / create

Method create

code/Common/DefaultLogger.cpp:126–163  ·  view source on GitHub ↗

---------------------------------------------------------------------------------- Creates the only singleton instance

Source from the content-addressed store, hash-verified

124// ----------------------------------------------------------------------------------
125// Creates the only singleton instance
126Logger *DefaultLogger::create(const char *name /*= "AssimpLog.txt"*/,
127 LogSeverity severity /*= NORMAL*/,
128 unsigned int defStreams /*= aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE*/,
129 IOSystem *io /*= nullptr*/) {
130 // enter the mutex here to avoid concurrency problems
131#ifndef ASSIMP_BUILD_SINGLETHREADED
132 std::lock_guard<std::mutex> lock(loggerMutex);
133#endif
134
135 if (m_pLogger && !isNullLogger()) {
136 delete m_pLogger;
137 }
138
139 m_pLogger = new DefaultLogger(severity);
140
141 // Attach default log streams
142 // Stream the log to the MSVC debugger?
143 if (defStreams & aiDefaultLogStream_DEBUGGER) {
144 m_pLogger->attachStream(LogStream::createDefaultStream(aiDefaultLogStream_DEBUGGER));
145 }
146
147 // Stream the log to COUT?
148 if (defStreams & aiDefaultLogStream_STDOUT) {
149 m_pLogger->attachStream(LogStream::createDefaultStream(aiDefaultLogStream_STDOUT));
150 }
151
152 // Stream the log to CERR?
153 if (defStreams & aiDefaultLogStream_STDERR) {
154 m_pLogger->attachStream(LogStream::createDefaultStream(aiDefaultLogStream_STDERR));
155 }
156
157 // Stream the log to a file
158 if (defStreams & aiDefaultLogStream_FILE && name && *name) {
159 m_pLogger->attachStream(LogStream::createDefaultStream(aiDefaultLogStream_FILE, name, io));
160 }
161
162 return m_pLogger;
163}
164
165// ----------------------------------------------------------------------------------
166void Logger::debug(const char *message) {

Callers

nothing calls this directly

Calls 1

attachStreamMethod · 0.80

Tested by

no test coverage detected