tribler.core.restapi.logging_endpoint

Classes

RotatingMemoryHandler

A custom MemoryHandler flusher. Instead of delegating to the target and flushing the buffer, simply keep

LoggingEndpoint

This endpoint allows retrieval of the logs.

Module Contents

class tribler.core.restapi.logging_endpoint.RotatingMemoryHandler(capacity, flushLevel=logging.ERROR, target=None, flushOnClose=True)

Bases: logging.handlers.MemoryHandler

A custom MemoryHandler flusher. Instead of delegating to the target and flushing the buffer, simply keep the last capacity records in the buffer.

flush() None

This is called when our buffer is at capacity and needs to be flushed. We get the handler lock and rotate the buffer.

class tribler.core.restapi.logging_endpoint.LoggingEndpoint

Bases: tribler.core.restapi.rest_endpoint.RESTEndpoint

This endpoint allows retrieval of the logs.

path = '/api/logging'
base_handler
memory_logger
async get_logs(request: aiohttp.web.Request) tribler.core.restapi.rest_endpoint.RESTResponse

Return the most recent logs.