Seastar's on_internal_error() is a useful replacement for assert() but it's inconvenient that it requires each caller to supply a logger - which is often inconvenient, especially when the caller is a header file. So in this patch we introduce a utils::on_internal_error() function which is the same as seastar::on_internal_error() (the former calls the latter), except it uses a single logger instead of asking the caller to pass a logger. Refs #7871 Signed-off-by: Nadav Har'El <nyh@scylladb.com>
22 lines
434 B
C++
22 lines
434 B
C++
/*
|
|
* Copyright (C) 2024-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
#include <seastar/core/on_internal_error.hh>
|
|
#include <seastar/util/log.hh>
|
|
|
|
#include "on_internal_error.hh"
|
|
|
|
static seastar::logger on_internal_error_logger("on_internal_error");
|
|
|
|
namespace utils {
|
|
|
|
[[noreturn]] void on_internal_error(std::string_view reason) {
|
|
seastar::on_internal_error(on_internal_error_logger, reason);
|
|
}
|
|
|
|
} |