diff --git a/components/debug/debuglog.cpp b/components/debug/debuglog.cpp index 0bc65ec24c..2bdb8ab139 100644 --- a/components/debug/debuglog.cpp +++ b/components/debug/debuglog.cpp @@ -39,22 +39,6 @@ Log::~Log() sLock.unlock(); } -Log& Log::operator<<(const std::filesystem::path&& rhs) -{ - if (mShouldLog) - std::cout << Files::pathToUnicodeString(std::move(rhs)); - - return *this; -} - -Log& Log::operator<<(std::filesystem::path&& rhs) -{ - if (mShouldLog) - std::cout << Files::pathToUnicodeString(std::move(rhs)); - - return *this; -} - Log& Log::operator<<(const std::filesystem::path& rhs) { if (mShouldLog) @@ -63,26 +47,10 @@ Log& Log::operator<<(const std::filesystem::path& rhs) return *this; } -Log& Log::operator<<(std::filesystem::path& rhs) +Log& Log::operator<<(const std::u8string& rhs) { if (mShouldLog) - std::cout << Files::pathToUnicodeString(rhs); - - return *this; -} - -Log& Log::operator<<(const std::u8string&& rhs) -{ - if (mShouldLog) - std::cout << Misc::StringUtils::u8StringToString(std::move(rhs)); - - return *this; -} - -Log& Log::operator<<(std::u8string&& rhs) -{ - if (mShouldLog) - std::cout << Misc::StringUtils::u8StringToString(std::move(rhs)); + std::cout << Misc::StringUtils::u8StringToString(rhs); return *this; } diff --git a/components/debug/debuglog.hpp b/components/debug/debuglog.hpp index 1b9bb21ef3..090f64c5ed 100644 --- a/components/debug/debuglog.hpp +++ b/components/debug/debuglog.hpp @@ -27,27 +27,18 @@ public: explicit Log(Debug::Level level); ~Log(); - // Perfect forwarding wrappers to give the chain of objects to cout template - Log& operator<<(T&& rhs) + Log& operator<<(const T& rhs) { if (mShouldLog) - std::cout << std::forward(rhs); + std::cout << rhs; return *this; } - Log& operator<<(const std::filesystem::path&& rhs); - - Log& operator<<(std::filesystem::path&& rhs); - Log& operator<<(const std::filesystem::path& rhs); - Log& operator<<(std::filesystem::path& rhs); - - Log& operator<<(const std::u8string&& rhs); - - Log& operator<<(std::u8string&& rhs); + Log& operator<<(const std::u8string& rhs); Log& operator<<(std::u8string_view rhs);