Skip to content

Commit

Permalink
Merge pull request #24509 from Lazin/fix/assert-unreachable-logger
Browse files Browse the repository at this point in the history
base: Rename assert-unreachable logger to assert
  • Loading branch information
dotnwat authored Dec 11, 2024
2 parents 1b5b8fe + 156aeea commit 828a9b0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/v/base/unreachable.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,17 @@

#pragma once

#include <seastar/util/backtrace.hh>
#include <seastar/util/log.hh>
#include "base/vassert.h"

namespace details {
// NOLINTNEXTLINE
inline seastar::logger _g_unreachable_assert_logger("assert-unreachable");
} // namespace details
#include <seastar/util/backtrace.hh>

// NOLINTNEXTLINE
#define unreachable() \
/* NOLINTNEXTLINE(cppcoreguidelines-avoid-do-while) */ \
do { \
::details::_g_unreachable_assert_logger.error( \
::detail::g_assert_log.l.error( \
"This code should not be reached ({}:{})", __FILE__, __LINE__); \
::details::_g_unreachable_assert_logger.error( \
::detail::g_assert_log.l.error( \
"Backtrace below:\n{}", seastar::current_backtrace()); \
__builtin_trap(); \
} while (0)

0 comments on commit 828a9b0

Please sign in to comment.