From aaa59980a9b0ffdc84d6e995f98b1f83e435a9ab Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 4 Jan 2024 10:44:49 +0100 Subject: [PATCH] transmit: print symbol size always in debug2 The symbol size is printed only once (or more precisely few times, because it is guarded by a thread-local variable and the sending may pick a different runner). This, however, doesn't give representative numbers when frame sizes differ (== compressed) because then may also FEC symbol sizes so print it unconditionally at least with debug2 log level. refers to GH-361 --- src/transmit.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/transmit.cpp b/src/transmit.cpp index a779a04c60..198982342b 100644 --- a/src/transmit.cpp +++ b/src/transmit.cpp @@ -478,7 +478,7 @@ static inline void check_symbol_size(int fec_symbol_size, int payload_len) { thread_local static bool status_printed = false; - if (status_printed) { + if (status_printed && log_level < LOG_LEVEL_DEBUG2) { return; } @@ -486,9 +486,13 @@ static inline void check_symbol_size(int fec_symbol_size, int payload_len) LOG(LOG_LEVEL_WARNING) << "Warning: FEC symbol size exceeds payload size! " "FEC symbol size: " << fec_symbol_size << "\n"; } else { - LOG(LOG_LEVEL_INFO) << "FEC symbol size: " << fec_symbol_size << ", symbols per packet: " << - payload_len / fec_symbol_size << ", payload size: " << - payload_len / fec_symbol_size * fec_symbol_size << "\n"; + const int ll = + status_printed ? LOG_LEVEL_DEBUG2 : LOG_LEVEL_INFO; + LOG(ll) << "FEC symbol size: " << fec_symbol_size + << ", symbols per packet: " + << payload_len / fec_symbol_size << ", payload size: " + << payload_len / fec_symbol_size * fec_symbol_size + << "\n"; } status_printed = true; }