21 lines
551 B
Python
21 lines
551 B
Python
import json
|
|
|
|
import switch_client
|
|
import todo
|
|
from extractors.xe_page import fetch_tables
|
|
|
|
PATH = "/BufferedLogs.html"
|
|
|
|
|
|
def get_buffered_log(session) -> list[dict]:
|
|
"""Returns one dict per log entry (Log Index, Severity, Log Time,
|
|
Component, Description, Message Text)."""
|
|
tables = fetch_tables(session, PATH)
|
|
return tables["Log Message"]["rows"]
|
|
|
|
|
|
if __name__ == "__main__":
|
|
session = switch_client.get_session()
|
|
print(json.dumps(get_buffered_log(session), indent=2))
|
|
todo.mark_implemented(switch_client.BASE_URL + PATH)
|