diff --git a/src/MeoAssistant/Logger.hpp b/src/MeoAssistant/Logger.hpp index 3a15367a39..787125cf1a 100644 --- a/src/MeoAssistant/Logger.hpp +++ b/src/MeoAssistant/Logger.hpp @@ -63,10 +63,6 @@ namespace asst std::string_view str; }; - struct _endl - {}; - static constexpr _endl endl {}; - class LogStream { public: @@ -76,6 +72,13 @@ namespace asst { (*this << ... << std::forward(buff)); } + ~LogStream() + { + m_ofs << std::endl; +#ifdef ASST_DEBUG + std::cout << std::endl; +#endif + } template LogStream& operator<<(T&& arg) @@ -83,9 +86,6 @@ namespace asst if constexpr (std::same_as>) { m_sep = std::forward(arg); } - else if constexpr (std::same_as<_endl, std::decay_t>) { - m_ofs << std::endl; - } else { if (!m_is_first) { #ifdef ASST_DEBUG @@ -210,7 +210,7 @@ namespace asst template inline void log(level lv, Args&&... args) { - log(lv, std::forward(args)...); + ((*this << lv) << ... << std::forward(args)); } void flush()