diff options
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2022-03-23 17:35:16 +0100 |
---|---|---|
committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2022-03-23 17:35:16 +0100 |
commit | 3f70986d57822e6b5d4df9e86821789a0f5d78da (patch) | |
tree | b888925808530ce084818c9b43c2cc84ac34b2d2 | |
parent | f4ce42c8c7357f6545f4d0e70882fef3fd02a4b0 (diff) | |
download | poezio-3f70986d57822e6b5d4df9e86821789a0f5d78da.tar.gz poezio-3f70986d57822e6b5d4df9e86821789a0f5d78da.tar.bz2 poezio-3f70986d57822e6b5d4df9e86821789a0f5d78da.tar.xz poezio-3f70986d57822e6b5d4df9e86821789a0f5d78da.zip |
logger: Remove unused function
-rw-r--r-- | poezio/logger.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/poezio/logger.py b/poezio/logger.py index 85b861e1..d1e8bfa0 100644 --- a/poezio/logger.py +++ b/poezio/logger.py @@ -400,26 +400,6 @@ def iterate_messages_reverse(filepath: Path) -> Generator[LogDict, None, None]: pass -def _get_lines_from_fd(fd: IO[Any], nb: int = 10) -> List[str]: - """ - Get the last log lines from a fileno with mmap - - :param fd: File descriptor on the log file - :param nb: number of messages to fetch - :returns: A list of message lines - """ - with mmap.mmap(fd.fileno(), 0, prot=mmap.PROT_READ) as m: - # start of messages begin with MI or MR, after a \n - pos = m.rfind(b"\nM") + 1 - # number of message found so far - count = 0 - while pos != 0 and count < nb - 1: - count += 1 - pos = m.rfind(b"\nM", 0, pos) + 1 - lines = m[pos:].decode(errors='replace').splitlines() - return lines - - def parse_log_lines(lines: List[str], jid: str = '') -> List[LogDict]: """ Parse raw log lines into poezio log objects |