Replacing a few std::cout with spdlog::info/error

This commit is contained in:
2023-05-09 19:36:34 +02:00
parent 52747202d3
commit 43fc721413
9 changed files with 24 additions and 24 deletions

View File

@ -47,7 +47,7 @@ protected:
return ASSET_TYPE::File;
}
else {
std::cout << "unknown file!" << std::endl;
spdlog::warn("unknown file!");
return ASSET_TYPE::Unknown;
}
}

View File

@ -94,11 +94,11 @@ Asset ModelLoader::LoadAsset(std::filesystem::path& path) {
aiNode* currentNode = scene->mRootNode;
std::cout << "Loading meshes!" << std::endl;
spdlog::info("Loading meshes!" );
auto meshes = processNode(currentNode, scene);
std::cout << "Model file contained " << meshes.size() << " meshes" << std::endl;
spdlog::info("Model file contained {0} meshes", meshes.size() );

View File

@ -45,10 +45,10 @@ YoggieEngine::Mesh* AssetRegistry::LoadFromAssetFile(const std::filesystem::path
AssetFile.read((char*)&Enum, sizeof(uint32_t));
// print Header info
std::cout << "File has header: " << Header << std::endl;
std::cout << "Vertex size: " << Vsize << std::endl;
std::cout << "Number of Vertices: " << Vnum << std::endl;
std::cout << "Number of Elements: " << Enum << std::endl;
spdlog::info("File has header: {0}", Header);
spdlog::info ( "Vertex size: {0}", Vsize );
spdlog::info("Number of Vertices: {0}" ,Vnum );
spdlog::info ("Number of Elements: " , Enum );
free(Header);
@ -77,7 +77,7 @@ YoggieEngine::Mesh* AssetRegistry::LoadFromAssetFile(const std::filesystem::path
}
else {
std::cout << "Failed ot open mesh " << std::endl;
spdlog::error( "Failed ot open mesh " );
}
return imported;
@ -92,7 +92,7 @@ YoggieEngine::Renderable* AssetRegistry::LoadFromSource(const std::filesystem::p
* auto model = (YoggieEngine::ModelImporter()).Import(srcPath.string());
YoggieEngine::Mesh* exportMesh = model->renderable->mesh;
std::filesystem::path MeshFileName = assetFolder / srcPath.filename().replace_extension(".mesh");
std::cout << "Save path: " << MeshFileName << std::endl;
spdlog::info( "Save path: {0}" , MeshFileName );
std::ofstream meshAsset;
meshAsset.open(MeshFileName, std::ios::binary);
@ -102,8 +102,8 @@ YoggieEngine::Renderable* AssetRegistry::LoadFromSource(const std::filesystem::p
static const char* HEADER = "MESH";
meshAsset.write(HEADER, sizeof(HEADER));
auto Vsize = sizeof(YoggieEngine::Vertex);
std::cout << "size of vertex: " << Vsize << std::endl;
std::cout << "Addr of vSize: " << &Vsize << std::endl;
spdlog::info( "size of vertex: {0}" ,Vsize );
spdlog::info("Addr of vSize: {0}" , &Vsize );
auto Vnum = exportMesh->vertices.size();
auto Enum = exportMesh->elements.size();

View File

@ -6,7 +6,7 @@
void WriteFile(std::string& emitter, std::filesystem::path path)
{
std::cout << "Writing Scene file to: " << path.u8string() << std::endl;
spdlog::info( "Writing Scene file to: {0}" , path.u8string());
std::ofstream sceneFile;
sceneFile.open(path.u8string());