Logger
GlobalLogger
A global logger to store all the requests made by the client.
log_request(log)
classmethod
Add a log entry to the logs list. Args: log: A dictionary containing the log entry.
get_logs()
classmethod
Get all the logs stored in the logger. Returns: A list of log entries.
Examples:
>>> from reqflow.utils.logger import GlobalLogger
>>>
>>> logs = GlobalLogger.get_logs()
>>> print(logs)
>>> [{'function': 'test_function', 'request': {'method': 'GET', 'url': 'https://some_url.com', 'params': {}, 'headers': {}, 'cookies': {}, 'json': None, 'data': None, 'redirect': 'auto', 'files': None, 'timeout': None}, 'response': {'status_code': 200, 'headers': {'Content-Type': 'application/json'}, 'content': b'{"key": "value"}', 'time': 0.123}}]
clear_logs()
classmethod
generate_html_report(file_path='test_report.html', report_title='Test Report')
classmethod
Generate an HTML report from the logs across all client instances. Args: file_path: (str) The path/name to save the HTML report. report_title: (str) The name of the report.
Examples: