diff --git a/src/libutil/fmt.hh b/src/libutil/fmt.hh index 0c9eeb607..515471e4c 100644 --- a/src/libutil/fmt.hh +++ b/src/libutil/fmt.hh @@ -10,11 +10,28 @@ #define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED #endif #include +#include +#include #include "ansicolor.hh" namespace nix { +/// Hot sale: order now and you can get two characters off of every fmt::format() call! +template +inline auto fmtformat(fmt::format_string format, Args && ...args) +{ + return fmt::format(format, std::forward(args)...); +} + +using fmt::println; + +template +inline void eprintln(fmt::format_string format, Args && ...args) +{ + return fmt::println(stderr, format, std::forward(args)...); +} + /** * Values wrapped in this struct are printed in magenta. *