From 88997f5728981358cfc1802a65dcd9b2ec654621 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 2 Sep 2020 20:57:51 +0200 Subject: [PATCH] Small old issue where the number of line filtered doesnt match the requested number, and then the admin doesn't display the 'show more line' button.. --- src/yunohost/log.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/yunohost/log.py b/src/yunohost/log.py index 58205d49c..892105c6b 100644 --- a/src/yunohost/log.py +++ b/src/yunohost/log.py @@ -269,11 +269,15 @@ def log_display(path, number=None, share=False, filter_irrelevant=False, with_su # Display logs if exist if os.path.exists(log_path): from yunohost.service import _tail - if number: + if number and filters: + logs = _tail(log_path, int(number*4)) + elif number: logs = _tail(log_path, int(number)) else: logs = read_file(log_path) logs = _filter_lines(logs, filters) + if number: + logs = logs[-number:] infos['log_path'] = log_path infos['logs'] = logs