24#include <seastar/core/format.hh>
25#include <seastar/core/sstring.hh>
26#include <seastar/util/modules.hh>
28#include <fmt/printf.h>
38operator<<(std::ostream&& os,
const void* ptr) {
44template <
typename... A>
45[[deprecated(
"use std::format_to() or fmt::print()")]]
47fprint(std::ostream& os,
const char* fmt, A&&... a) {
48 ::fmt::fprintf(os, fmt, std::forward<A>(a)...);
52template <
typename... A>
53[[deprecated(
"use std::format_to() or fmt::print()")]]
55print(
const char* fmt, A&&... a) {
56 ::fmt::printf(fmt, std::forward<A>(a)...);
59template <
typename... A>
60[[deprecated(
"use std::format() or fmt::format()")]]
62sprint(
const char* fmt, A&&... a) {
63 std::ostringstream os;
64 ::fmt::fprintf(os, fmt, std::forward<A>(a)...);
68template <
typename... A>
69[[deprecated(
"use std::format() or fmt::format()")]]
71sprint(
const sstring& fmt, A&&... a) {
72 std::ostringstream os;
73 ::fmt::fprintf(os, fmt.c_str(), std::forward<A>(a)...);
77template <
typename Iterator>
78[[deprecated(
"use fmt::join()")]]
80format_separated(Iterator b, Iterator e,
const char* sep =
", ") {
93template <
typename TimePo
int>
98template <
typename TimePo
int>
101usecfmt(TimePoint tp) {
105template <
typename Clock,
typename Rep,
typename Period>
107operator<<(std::ostream& os, usecfmt_wrapper<std::chrono::time_point<Clock, std::chrono::duration<Rep, Period>>> tp) {
108 auto usec = std::chrono::duration_cast<std::chrono::microseconds>(tp.val.time_since_epoch()).count();
109 std::ostream tmp(os.rdbuf());
110 tmp << std::setw(12) << (usec / 1000000) <<
"." << std::setw(6) << std::setfill(
'0') << (usec % 1000000);
114template <
typename... A>
118 print(std::forward<A>(a)...);
123template <
typename... A>
124[[deprecated(
"use std::format() or fmt::print()")]]
126fmt_print(std::ostream& os,
const char*
format, A&&... a) {
127 fmt::print(os,
format, std::forward<A>(a)...);
future now()
Returns a ready future.
Definition: later.hh:35
Seastar API namespace.
Definition: abort_on_ebadf.hh:26
sstring format(fmt::format_string< A... > fmt, A &&... a)
Definition: format.hh:42