base
log_panel.backends.base
¶
LogsBackend
¶
Bases: ABC
get_logger_cards(now_utc, range_config, app_timezone)
abstractmethod
¶
Return per-logger aggregation rows for the cards view.
Each row must contain: { 'logger_name': str, 'total': int, 'total_errors': int, 'total_warnings': int, 'recent_errors': int, # last hour 'recent_warnings': int, # last hour 'last_seen': datetime, 'timeline': [{'label': str, 'status': 'ok'|'warning'|'error'|'empty', 'timestamp_from': str, 'timestamp_to': str}, ...], }
Source code in log_panel/backends/base.py
query_logs(logger_names, levels, search, offset, limit, app_timezone, timestamp_from=None, timestamp_to=None)
abstractmethod
¶
Return log entries with flexible multi-value filters.
Intended for use with :class:log_panel.managers.LogReader in
non-admin views. Unlike get_log_table, this method accepts lists
for both logger names and levels so that role-based visibility filters
can restrict results across multiple loggers or a minimum severity.
Each entry must contain at least: { 'timestamp': datetime (tz-aware, app timezone), 'level': str, 'logger_name': str, 'module': str, 'message': str }
Source code in log_panel/backends/base.py
count_logs(logger_names, levels, search, timestamp_from=None, timestamp_to=None)
abstractmethod
¶
Return the total number of log entries matching the given filters.
Source code in log_panel/backends/base.py
get_modules(logger_name)
abstractmethod
¶
get_log_table(logger_name, level, search, page, page_size, app_timezone, timestamp_from=None, timestamp_to=None, module='')
abstractmethod
¶
Return (log_entries, total_count) for the table view.
Each entry must contain at least: { 'timestamp': datetime (tz-aware, app timezone), 'level': str, 'module': str, 'message': str }
Source code in log_panel/backends/base.py
get_local_now_and_slot_delta(now_utc, app_timezone, configured_unit)
staticmethod
¶
Return the current local slot boundary and its delta.