INtroduce new log macros.

This commit is contained in:
kimkulling
2018-04-26 14:10:18 +02:00
parent 0e15b25cd1
commit 30c20eb5fc
65 changed files with 413 additions and 531 deletions

View File

@@ -132,7 +132,7 @@ const aiImporterDesc* NFFImporter::GetInfo () const
// ------------------------------------------------------------------------------------------------
// Loads the materail table for the NFF2 file format from an external file
// Loads the material table for the NFF2 file format from an external file
void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
const std::string& path, IOSystem* pIOHandler)
{
@@ -140,7 +140,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
// Check whether we can read from the file
if( !file.get()) {
DefaultLogger::get()->error("NFF2: Unable to open material library " + path + ".");
ASSIMP_LOG_ERROR("NFF2: Unable to open material library " + path + ".");
return;
}
@@ -158,7 +158,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
// The file should start with the magic sequence "mat"
if (!TokenMatch(buffer,"mat",3)) {
DefaultLogger::get()->error("NFF2: Not a valid material library " + path + ".");
ASSIMP_LOG_ERROR_F("NFF2: Not a valid material library ", path, ".");
return;
}
@@ -174,7 +174,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
// 'version' defines the version of the file format
if (TokenMatch(sz,"version",7))
{
DefaultLogger::get()->info("NFF (Sense8) material library file format: " + std::string(sz));
ASSIMP_LOG_INFO_F("NFF (Sense8) material library file format: ", std::string(sz));
}
// 'matdef' starts a new material in the file
else if (TokenMatch(sz,"matdef",6))
@@ -192,8 +192,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
{
if (!curShader)
{
DefaultLogger::get()->error(std::string("NFF2 material library: Found element ") +
sz + "but there is no active material");
ASSIMP_LOG_ERROR_F("NFF2 material library: Found element ", sz, "but there is no active material");
continue;
}
}
@@ -308,7 +307,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
SkipSpaces(line,&sz);
if (TokenMatch(sz,"version",7))
{
DefaultLogger::get()->info("NFF (Sense8) file format: " + std::string(sz));
ASSIMP_LOG_INFO_F("NFF (Sense8) file format: ", sz );
}
else if (TokenMatch(sz,"viewpos",7))
{
@@ -471,7 +470,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
unsigned int m = ::strtoul10(sz,&sz);
if (m >= (unsigned int)tempPositions.size())
{
DefaultLogger::get()->error("NFF2: Vertex index overflow");
ASSIMP_LOG_ERROR("NFF2: Vertex index overflow");
m= 0;
}
// mesh.vertices.push_back (tempPositions[idx]);
@@ -577,7 +576,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
matIdx = ::strtoul10(sz,&sz);
if (matIdx >= materialTable.size())
{
DefaultLogger::get()->error("NFF2: Material index overflow.");
ASSIMP_LOG_ERROR("NFF2: Material index overflow.");
matIdx = 0;
}
@@ -750,7 +749,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
{
if(!GetNextLine(buffer,line))
{
DefaultLogger::get()->error("NFF: Unexpected EOF was encountered. Patch definition incomplete");
ASSIMP_LOG_ERROR("NFF: Unexpected EOF was encountered. Patch definition incomplete");
continue;
}
@@ -943,7 +942,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
if(!GetNextLine(buffer,line))
{
DefaultLogger::get()->error("NFF: Unexpected end of file (cone definition not complete)");
ASSIMP_LOG_ERROR("NFF: Unexpected end of file (cone definition not complete)");
break;
}
sz = line;
@@ -955,7 +954,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
if(!GetNextLine(buffer,line))
{
DefaultLogger::get()->error("NFF: Unexpected end of file (cone definition not complete)");
ASSIMP_LOG_ERROR("NFF: Unexpected end of file (cone definition not complete)");
break;
}
sz = line;
@@ -971,7 +970,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
float f;
if (( f = currentMesh.dir.Length()) < 10e-3f )
{
DefaultLogger::get()->error("NFF: Cone height is close to zero");
ASSIMP_LOG_ERROR("NFF: Cone height is close to zero");
continue;
}
currentMesh.dir /= f; // normalize
@@ -1029,18 +1028,20 @@ void NFFImporter::InternReadFile( const std::string& pFile,
// 'pb' - bezier patch. Not supported yet
else if (TokenMatch(sz,"pb",2))
{
DefaultLogger::get()->error("NFF: Encountered unsupported ID: bezier patch");
ASSIMP_LOG_ERROR("NFF: Encountered unsupported ID: bezier patch");
}
// 'pn' - NURBS. Not supported yet
else if (TokenMatch(sz,"pn",2) || TokenMatch(sz,"pnn",3))
{
DefaultLogger::get()->error("NFF: Encountered unsupported ID: NURBS");
ASSIMP_LOG_ERROR("NFF: Encountered unsupported ID: NURBS");
}
// '' - comment
else if ('#' == line[0])
{
const char* sz;SkipSpaces(&line[1],&sz);
if (!IsLineEnd(*sz))DefaultLogger::get()->info(sz);
if (!IsLineEnd(*sz)) {
ASSIMP_LOG_INFO(sz);
}
}
}
}