mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Display log list in chronological order in CLI to avoid having to scroll to get the last action
This commit is contained in:
parent
f89c41f3e4
commit
6d6d778a7b
1 changed files with 6 additions and 1 deletions
|
@ -57,10 +57,10 @@ def log_list(category=[], limit=None):
|
|||
"""
|
||||
|
||||
categories = category
|
||||
is_api = msettings.get('interface') == 'api'
|
||||
|
||||
# In cli we just display `operation` logs by default
|
||||
if not categories:
|
||||
is_api = msettings.get('interface') == 'api'
|
||||
categories = ["operation"] if not is_api else CATEGORIES
|
||||
|
||||
result = collections.OrderedDict()
|
||||
|
@ -101,6 +101,11 @@ def log_list(category=[], limit=None):
|
|||
|
||||
result[category].append(entry)
|
||||
|
||||
# Reverse the order of log when in cli, more comfortable to read (avoid unecessary scrolling)
|
||||
if not is_api:
|
||||
for category in result:
|
||||
result[category] = list(reversed(result[category]))
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue