Skip to content

Commit ec65bed

Browse files
committed
log, timer: add LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE macro
that prints the descriptive message when logging the start but not when logging the completion.
1 parent 325da75 commit ec65bed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/logging/timer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ class Timer
100100
BCLog::Timer<std::chrono::microseconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, log_category)
101101
#define LOG_TIME_MILLIS_WITH_CATEGORY(end_msg, log_category) \
102102
BCLog::Timer<std::chrono::milliseconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, log_category)
103+
#define LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE(end_msg, log_category) \
104+
BCLog::Timer<std::chrono::milliseconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg, log_category, /* msg_on_completion=*/false)
103105
#define LOG_TIME_SECONDS(end_msg) \
104106
BCLog::Timer<std::chrono::seconds> PASTE2(logging_timer, __COUNTER__)(__func__, end_msg)
105107

0 commit comments

Comments
 (0)