commit 4d2136b1fa14d6f0ecf359a55a572964792d1b82 Author: Damian Johnson atagar@torproject.org Date: Sat Oct 28 17:33:06 2017 -0700
Drop deduplication message if there aren't any duplicates
It's rare, but once I spotted a "[0 duplicates hidden]" in my logs. Reason is that the message deduplicated, but then the log got long enough that the duplicate was dropped. --- nyx/panel/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nyx/panel/log.py b/nyx/panel/log.py index 32cbfef..c29f21e 100644 --- a/nyx/panel/log.py +++ b/nyx/panel/log.py @@ -406,7 +406,7 @@ def _draw_entry(subwindow, x, y, width, entry, show_duplicates): for line in entry.display_message.splitlines(): x, y = subwindow.addstr_wrap(x, y, line, width, min_x, boldness, color)
- if entry.duplicates and not show_duplicates: + if entry.duplicates and len(entry.duplicates) != 1 and not show_duplicates: duplicate_count = len(entry.duplicates) - 1 plural = 's' if duplicate_count > 1 else '' duplicate_msg = ' [%i duplicate%s hidden]' % (duplicate_count, plural)