mirror of https://github.com/zulip/zulip.git
log-search: Handle ^C more gracefully.
This commit is contained in:
parent
da4ae3ff24
commit
fe17a4d6d0
|
@ -4,6 +4,7 @@ import argparse
|
|||
import gzip
|
||||
import os
|
||||
import re
|
||||
import signal
|
||||
import sys
|
||||
from enum import Enum, auto
|
||||
from typing import Callable, TextIO
|
||||
|
@ -215,6 +216,7 @@ def main() -> None:
|
|||
raise RuntimeError(f"Can't parse {filter} as an IP or hostname.")
|
||||
assert filter_type is not None
|
||||
|
||||
try:
|
||||
for logfile_name in reversed(logfile_names):
|
||||
with maybe_gzip(logfile_name) as logfile:
|
||||
for logline in logfile:
|
||||
|
@ -238,6 +240,8 @@ def main() -> None:
|
|||
args,
|
||||
filter_type=filter_type,
|
||||
)
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(signal.SIGINT + 128)
|
||||
|
||||
|
||||
def passes_filters(
|
||||
|
|
Loading…
Reference in New Issue