diff --git a/src/debug/log.hpp b/src/debug/log.hpp index 83a069bbf..e2a3fbea4 100644 --- a/src/debug/log.hpp +++ b/src/debug/log.hpp @@ -1,6 +1,6 @@ #pragma once -#include "fmt/format.h" +#include "util/helpers.hpp" #include #include @@ -20,18 +20,8 @@ static void _log(const std::string &message) template inline void Log(const std::string &formatString, Args &&... args) { - detail::_log(fmt::format(formatString, std::forward(args)...)); + detail::_log(fS(formatString, std::forward(args)...)); } } // namespace debug } // namespace chatterino - -namespace fmt { - -// format_arg for QString -inline void format_arg(BasicFormatter &f, const char *&, const QString &v) -{ - f.writer().write("\"{}\"", v.toStdString()); -} - -} // namespace fmt diff --git a/src/util/helpers.hpp b/src/util/helpers.hpp index 8435a3494..3e495ae1d 100644 --- a/src/util/helpers.hpp +++ b/src/util/helpers.hpp @@ -11,3 +11,13 @@ auto fS(Args &&... args) -> decltype(fmt::format(std::forward(args)...)) } } // namespace chatterino + +namespace fmt { + +// format_arg for QString +inline void format_arg(BasicFormatter &f, const char *&, const QString &v) +{ + f.writer().write("\"{}\"", v.toStdString()); +} + +} // namespace fmt