Fast path for unformatted calls.
This commit is contained in:
@@ -163,55 +163,54 @@ Logger *DefaultLogger::create(const char *name /*= "AssimpLog.txt"*/,
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::debugInternal(Assimp::Formatter::format f) {
|
||||
std::string message = f;
|
||||
void Logger::debug(const char *message) {
|
||||
|
||||
// SECURITY FIX: otherwise it's easy to produce overruns since
|
||||
// sometimes importers will include data from the input file
|
||||
// (i.e. node names) in their messages.
|
||||
if (message.length() > MAX_LOG_MESSAGE_LENGTH) {
|
||||
if (strlen(message) > MAX_LOG_MESSAGE_LENGTH) {
|
||||
return;
|
||||
}
|
||||
return OnDebug(message.c_str());
|
||||
return OnDebug(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::verboseDebugInternal(Assimp::Formatter::format f) {
|
||||
std::string message = f;
|
||||
void Logger::verboseDebug(const char *message) {
|
||||
|
||||
// SECURITY FIX: see above
|
||||
if (message.length() > MAX_LOG_MESSAGE_LENGTH) {
|
||||
if (strlen(message) > MAX_LOG_MESSAGE_LENGTH) {
|
||||
return;
|
||||
}
|
||||
return OnVerboseDebug(message.c_str());
|
||||
return OnVerboseDebug(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::infoInternal(Assimp::Formatter::format f) {
|
||||
std::string message = f;
|
||||
void Logger::info(const char *message) {
|
||||
|
||||
// SECURITY FIX: see above
|
||||
if (message.length() > MAX_LOG_MESSAGE_LENGTH) {
|
||||
if (strlen(message) > MAX_LOG_MESSAGE_LENGTH) {
|
||||
return;
|
||||
}
|
||||
return OnInfo(message.c_str());
|
||||
return OnInfo(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::warnInternal(Assimp::Formatter::format f) {
|
||||
std::string message = f;
|
||||
void Logger::warn(const char *message) {
|
||||
|
||||
// SECURITY FIX: see above
|
||||
if (message.length() > MAX_LOG_MESSAGE_LENGTH) {
|
||||
if (strlen(message) > MAX_LOG_MESSAGE_LENGTH) {
|
||||
return;
|
||||
}
|
||||
return OnWarn(message.c_str());
|
||||
return OnWarn(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::errorInternal(Assimp::Formatter::format f) {
|
||||
std::string message = f;
|
||||
void Logger::error(const char *message) {
|
||||
// SECURITY FIX: see above
|
||||
if (message.length() > MAX_LOG_MESSAGE_LENGTH) {
|
||||
if (strlen(message) > MAX_LOG_MESSAGE_LENGTH) {
|
||||
return;
|
||||
}
|
||||
return OnError(message.c_str());
|
||||
return OnError(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user