Skip to content

Commit 96b4176

Browse files
authored
Merge pull request #72 from sy-c/master
automute cosmetics
2 parents d8759d9 + e5aadef commit 96b4176

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

doc/releaseNotes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,6 @@ This file describes the main feature changes for each InfoLogger released versio
9797

9898
## v2.1.0 - 11/05/2021
9999
- API: added auto-mute feature for potentially verbose/repetitive messages. To be enabled message per message, using an AutoMuteToken (c++ only, see InfoLogger.hxx and testInfoLogger.cxx).
100+
101+
## v2.1.1 - 28/06/2021
102+
- minor cosmetics for auto-mute feature.

src/InfoLogger.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,9 @@ int InfoLogger::log(AutoMuteToken &limit, const char* message, ...) {
11421142
if ((limit.ndiscarded == 0) || ((std::chrono::duration_cast<std::chrono::seconds>(now - limit.t1)).count() >= limit.interval)) {
11431143
// no message discarded / no message at all for one period, reset full count
11441144
limit.count = 1;
1145-
log(limit.logOptions, LOG_MUTE_PREFIX "It was quiet for a while, restoring full logging for similar messages");
1145+
if (limit.ndiscarded != 0) {
1146+
log(limit.logOptions, LOG_MUTE_PREFIX "It was quiet for a while, restoring full logging for similar messages");
1147+
}
11461148
limit.ndiscardedtotal = 0;
11471149
}
11481150
// reset period

0 commit comments

Comments
 (0)