Skip to content

Commit aaa5998

Browse files
committedJan 4, 2024
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
1 parent 0bba07c commit aaa5998

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎src/transmit.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -478,17 +478,21 @@ static inline void check_symbol_size(int fec_symbol_size, int payload_len)
478478
{
479479
thread_local static bool status_printed = false;
480480

481-
if (status_printed) {
481+
if (status_printed && log_level < LOG_LEVEL_DEBUG2) {
482482
return;
483483
}
484484

485485
if (fec_symbol_size > payload_len) {
486486
LOG(LOG_LEVEL_WARNING) << "Warning: FEC symbol size exceeds payload size! "
487487
"FEC symbol size: " << fec_symbol_size << "\n";
488488
} else {
489-
LOG(LOG_LEVEL_INFO) << "FEC symbol size: " << fec_symbol_size << ", symbols per packet: " <<
490-
payload_len / fec_symbol_size << ", payload size: " <<
491-
payload_len / fec_symbol_size * fec_symbol_size << "\n";
489+
const int ll =
490+
status_printed ? LOG_LEVEL_DEBUG2 : LOG_LEVEL_INFO;
491+
LOG(ll) << "FEC symbol size: " << fec_symbol_size
492+
<< ", symbols per packet: "
493+
<< payload_len / fec_symbol_size << ", payload size: "
494+
<< payload_len / fec_symbol_size * fec_symbol_size
495+
<< "\n";
492496
}
493497
status_printed = true;
494498
}

0 commit comments

Comments
 (0)
Please sign in to comment.