diff --git a/apps/io_tester/ioinfo.cc b/apps/io_tester/ioinfo.cc index 0f0909b4c5..ec4e840a91 100644 --- a/apps/io_tester/ioinfo.cc +++ b/apps/io_tester/ioinfo.cc @@ -18,6 +18,7 @@ /* * Copyright (C) 2021 ScyllaDB */ +#include #include #include #include diff --git a/apps/rpc_tester/rpc_tester.cc b/apps/rpc_tester/rpc_tester.cc index 805c5025ad..99b6bd8daa 100644 --- a/apps/rpc_tester/rpc_tester.cc +++ b/apps/rpc_tester/rpc_tester.cc @@ -19,6 +19,7 @@ * Copyright (C) 2022 ScyllaDB */ +#include #include #include #include diff --git a/demos/rpc_demo.cc b/demos/rpc_demo.cc index dd7abbfc8a..9c68381338 100644 --- a/demos/rpc_demo.cc +++ b/demos/rpc_demo.cc @@ -19,6 +19,7 @@ * Copyright 2015 Cloudius Systems */ #include +#include #include #include #include diff --git a/include/seastar/core/format.hh b/include/seastar/core/format.hh new file mode 100644 index 0000000000..8cd030c644 --- /dev/null +++ b/include/seastar/core/format.hh @@ -0,0 +1,48 @@ +/* + * This file is open source software, licensed to you under the terms + * of the Apache License, Version 2.0 (the "License"). See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. You may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +/* + * Copyright (C) 2014 Cloudius Systems, Ltd. + */ + +#pragma once + +#include +#ifndef SEASTAR_MODULE +#include +#endif + +namespace seastar { + +/** + * Evaluate the formatted string in a native fmt library format + * + * @param fmt format string with the native fmt library syntax + * @param a positional parameters + * + * @return sstring object with the result of applying the given positional + * parameters on a given format string. + */ +template +sstring +format(fmt::format_string fmt, A&&... a) { + fmt::memory_buffer out; + fmt::format_to(fmt::appender(out), fmt, std::forward(a)...); + return sstring{out.data(), out.size()}; +} + +} diff --git a/include/seastar/core/internal/estimated_histogram.hh b/include/seastar/core/internal/estimated_histogram.hh index fff87dc70d..636a3336d4 100644 --- a/include/seastar/core/internal/estimated_histogram.hh +++ b/include/seastar/core/internal/estimated_histogram.hh @@ -25,8 +25,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/include/seastar/core/print.hh b/include/seastar/core/print.hh index 6369f52fd8..9cdea66622 100644 --- a/include/seastar/core/print.hh +++ b/include/seastar/core/print.hh @@ -21,10 +21,10 @@ #pragma once +#include #include #include #ifndef SEASTAR_MODULE -#include #include #include #include @@ -118,22 +118,6 @@ log(A&&... a) { print(std::forward(a)...); } -/** - * Evaluate the formatted string in a native fmt library format - * - * @param fmt format string with the native fmt library syntax - * @param a positional parameters - * - * @return sstring object with the result of applying the given positional - * parameters on a given format string. - */ -template -sstring -format(fmt::format_string fmt, A&&... a) { - fmt::memory_buffer out; - fmt::format_to(fmt::appender(out), fmt, std::forward(a)...); - return sstring{out.data(), out.size()}; -} // temporary, use fmt::print() instead template diff --git a/include/seastar/net/packet-util.hh b/include/seastar/net/packet-util.hh index 3e27189926..a35829368f 100644 --- a/include/seastar/net/packet-util.hh +++ b/include/seastar/net/packet-util.hh @@ -23,7 +23,6 @@ #include #include -#include namespace seastar { @@ -145,8 +144,7 @@ public: continue; } else { // If we reach here, we have a bug with merge. - std::cerr << "packet_merger: merge error\n"; - abort(); + std::abort(); break; } } diff --git a/include/seastar/rpc/rpc_impl.hh b/include/seastar/rpc/rpc_impl.hh index 818d730eb7..54d8b1d99c 100644 --- a/include/seastar/rpc/rpc_impl.hh +++ b/include/seastar/rpc/rpc_impl.hh @@ -20,6 +20,7 @@ */ #pragma once +#include #include #include #include @@ -27,7 +28,6 @@ #include #include #include -#include #include // for compatibility diff --git a/include/seastar/util/backtrace.hh b/include/seastar/util/backtrace.hh index 8ef7724af9..5a4dbad54e 100644 --- a/include/seastar/util/backtrace.hh +++ b/include/seastar/util/backtrace.hh @@ -21,8 +21,8 @@ #pragma once +#include #include -#include #include #include #include @@ -36,6 +36,7 @@ #include #include #include +#include #endif namespace seastar { diff --git a/include/seastar/util/program-options.hh b/include/seastar/util/program-options.hh index 54e52ed715..fd48c2603f 100644 --- a/include/seastar/util/program-options.hh +++ b/include/seastar/util/program-options.hh @@ -21,8 +21,8 @@ #pragma once +#include #include -#include #include #ifndef SEASTAR_MODULE diff --git a/src/net/dpdk.cc b/src/net/dpdk.cc index 2217f476a8..92ce8c19f7 100644 --- a/src/net/dpdk.cc +++ b/src/net/dpdk.cc @@ -26,6 +26,7 @@ module; #include #include +#include #include #include #include diff --git a/src/net/native-stack-impl.hh b/src/net/native-stack-impl.hh index ead10f618e..cd50017949 100644 --- a/src/net/native-stack-impl.hh +++ b/src/net/native-stack-impl.hh @@ -21,15 +21,14 @@ #pragma once -#ifndef SEASTAR_MODULE -#include -#endif - #include #include +#include namespace seastar { +extern logger seastar_logger; + namespace net { using namespace seastar; @@ -135,7 +134,7 @@ public: virtual void set_reuseaddr(bool reuseaddr) override { // FIXME: implement - std::cerr << "Reuseaddr is not supported by native stack" << std::endl; + seastar_logger.error("Reuseaddr is not supported by native stack"); } virtual bool get_reuseaddr() const override { @@ -244,7 +243,7 @@ native_connected_socket_impl::get_nodelay() const { template void native_connected_socket_impl::set_keepalive(bool keepalive) { // FIXME: implement - std::cerr << "Keepalive is not supported by native stack" << std::endl; + seastar_logger.error("Keepalive is not supported by native stack"); } template bool native_connected_socket_impl::get_keepalive() const { @@ -255,7 +254,7 @@ bool native_connected_socket_impl::get_keepalive() const { template void native_connected_socket_impl::set_keepalive_parameters(const keepalive_params&) { // FIXME: implement - std::cerr << "Keepalive parameters are not supported by native stack" << std::endl; + seastar_logger.error("Keepalive parameters are not supported by native stack"); } template