From 795deac7277eeb30955aeaa1a28fe85daa4db3a0 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Fri, 22 Dec 2017 14:07:58 +0100 Subject: [PATCH] move QString-formatting to helpers.hpp so fS works with it all the time --- src/debug/log.hpp | 14 ++------------ src/util/helpers.hpp | 10 ++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) 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