From 356e261fba1a6e401509bcacc8f0b7dd01d4c3d5 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Sat, 13 Mar 2021 20:02:47 +0100 Subject: [PATCH] print sanitized name in warnings and info messages --- src/io.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/io.cpp b/src/io.cpp index b6dd1bf..467da35 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -334,21 +334,22 @@ std::optional loadTexture(const std::string &name, const std::string &m std::replace(sanitizedName.begin(), sanitizedName.end(), '\\', '/'); std::optional stream = FileInputStream::open(sanitizedName, OpenMode::BINARY); if (not stream.has_value()) { - VXIO_LOG(WARNING, "Failed to open texture file \"" + name + "\" of material \"" + material + '"'); + VXIO_LOG(WARNING, "Failed to open texture file \"" + sanitizedName + "\" of material \"" + material + '"'); return std::nullopt; } std::string err; std::optional image = voxelio::png::decode(*stream, 4, err); if (not image.has_value()) { - VXIO_LOG(WARNING, "Could open, but failed to decode texture \"" + name + "\" of material \"" + material + '"'); + VXIO_LOG(WARNING, + "Could open, but failed to decode texture \"" + sanitizedName + "\" of material \"" + material + '"'); VXIO_LOG(WARNING, "Caused by STBI error: " + err); return std::nullopt; } VXIO_ASSERT(err.empty()); image->setWrapMode(WrapMode::REPEAT); - VXIO_LOG(INFO, "Loaded texture \"" + name + "\""); + VXIO_LOG(INFO, "Loaded texture \"" + sanitizedName + "\""); return Texture{std::move(*image)}; }