From dfc9b0901ddde77d7e3c8f823d22de0c78cc4c5e Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 8 Apr 2022 12:59:36 -0400 Subject: [PATCH] Improve feedback on no match found for log search --- confluent_client/confluent/logreader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/confluent_client/confluent/logreader.py b/confluent_client/confluent/logreader.py index bed32c22..94034d06 100644 --- a/confluent_client/confluent/logreader.py +++ b/confluent_client/confluent/logreader.py @@ -251,7 +251,7 @@ def _replay_to_console(txtfile, binfile): searchstr = searchstr[:-1] newdata, delay = replay.search(searchstr) if not newdata: - sys.stdout.write('\x1b[1K\rNo match found!') + sys.stdout.write('\x1b[1K\rNo match found') prepend = b'\x1b[1K\x1b8' else: sys.stdout.write('\x1b[1K\x1b8') @@ -260,6 +260,10 @@ def _replay_to_console(txtfile, binfile): break elif myinput.lower() == 'n' and searchstr: newdata, delay = replay.search(searchstr, True) + if not newdata: + sys.stdout.write('\x1b7\x1b[99999;0H\x1b[2KNo more matches found') + sys.stdout.flush() + prepend = b'\x1b[1K\x1b8' skipnext = True break else: