diff --git a/include/assimp/Logger.hpp b/include/assimp/Logger.hpp index cb9ef3770..3ca4a6cb2 100644 --- a/include/assimp/Logger.hpp +++ b/include/assimp/Logger.hpp @@ -105,7 +105,7 @@ public: template void debug(T&&... args) { - debugFormat(Assimp::Formatter::format(), std::forward(args)...); + debug(formatMessage(std::forward(args)...).c_str()); } // ---------------------------------------------------------------------- @@ -115,7 +115,7 @@ public: template void verboseDebug(T&&... args) { - verboseDebugFormat(Assimp::Formatter::format(), std::forward(args)...); + verboseDebug(formatMessage(std::forward(args)...).c_str()); } // ---------------------------------------------------------------------- @@ -125,7 +125,7 @@ public: template void info(T&&... args) { - infoFormat(Assimp::Formatter::format(), std::forward(args)...); + info(formatMessage(std::forward(args)...).c_str()); } // ---------------------------------------------------------------------- @@ -135,7 +135,7 @@ public: template void warn(T&&... args) { - warnFormat(Assimp::Formatter::format(), std::forward(args)...); + warn(formatMessage(std::forward(args)...).c_str()); } // ---------------------------------------------------------------------- @@ -145,7 +145,7 @@ public: template void error(T&&... args) { - errorFormat(Assimp::Formatter::format(), std::forward(args)...); + error(formatMessage(std::forward(args)...).c_str()); } // ---------------------------------------------------------------------- @@ -244,51 +244,14 @@ protected: * the function is left. */ virtual void OnError(const char* message) = 0; - protected: - void debugFormat(Assimp::Formatter::format f) { - debug(std::string(f).c_str()); + std::string formatMessage(Assimp::Formatter::format f) { + return f; } template - void debugFormat(Assimp::Formatter::format f, U&& u, T&&... args) { - debugFormat(std::move(f << std::forward(u)), std::forward(args)...); - } - - void verboseDebugFormat(Assimp::Formatter::format f) { - verboseDebug(std::string(f).c_str()); - } - - template - void verboseDebugFormat(Assimp::Formatter::format f, U&& u, T&&... args) { - verboseDebugFormat(std::move(f << std::forward(u)), std::forward(args)...); - } - - void warnFormat(Assimp::Formatter::format f) { - warn(std::string(f).c_str()); - } - - template - void warnFormat(Assimp::Formatter::format f, U&& u, T&&... args) { - warnFormat(std::move(f << std::forward(u)), std::forward(args)...); - } - - void infoFormat(Assimp::Formatter::format f) { - info(std::string(f).c_str()); - } - - template - void infoFormat(Assimp::Formatter::format f, U&& u, T&&... args) { - infoFormat(std::move(f << std::forward(u)), std::forward(args)...); - } - - void errorFormat(Assimp::Formatter::format f) { - error(std::string(f).c_str()); - } - - template - void errorFormat(Assimp::Formatter::format f, U&& u, T&&... args) { - errorFormat(std::move(f << std::forward(u)), std::forward(args)...); + std::string formatMessage(Assimp::Formatter::format f, U&& u, T&&... args) { + return formatMessage(std::move(f << std::forward(u)), std::forward(args)...); } protected: