From b408eac98ea79c94008f793516df1c9e0e4a836e Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sat, 30 Nov 2024 10:18:58 -0500 Subject: [PATCH] trace: add file and line numbers all the way up the stack These were added to crucible all the way back in 2018 (1beb61fb78ba "crucible: error: record location of exception in what() message") but it's even more useful in the stack tracer in bees. Signed-off-by: Zygo Blaxell --- src/bees.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bees.h b/src/bees.h index 4dbc005..93cd461 100644 --- a/src/bees.h +++ b/src/bees.h @@ -123,7 +123,7 @@ const int FLAGS_OPEN_FANOTIFY = O_RDWR | O_NOATIME | O_CLOEXEC | O_LARGEFILE; #define BEESLOG(lv,x) do { if (lv < bees_log_level) { Chatter __chatter(lv, BeesNote::get_name()); __chatter << x; } } while (0) #define BEESLOGTRACE(x) do { BEESLOG(LOG_DEBUG, x); BeesTracer::trace_now(); } while (0) -#define BEESTRACE(x) BeesTracer SRSLY_WTF_C(beesTracer_, __LINE__) ([&]() { BEESLOG(LOG_ERR, x); }) +#define BEESTRACE(x) BeesTracer SRSLY_WTF_C(beesTracer_, __LINE__) ([&]() { BEESLOG(LOG_ERR, x << " at " << __FILE__ << ":" << __LINE__); }) #define BEESTOOLONG(x) BeesTooLong SRSLY_WTF_C(beesTooLong_, __LINE__) ([&](ostream &_btl_os) { _btl_os << x; }) #define BEESNOTE(x) BeesNote SRSLY_WTF_C(beesNote_, __LINE__) ([&](ostream &_btl_os) { _btl_os << x; })