Logging Handlers

class CustomQueueHandler(queue)[source]

Bases: QueueHandler

Prevents mutation of LogRecord objects before queuing.

prepare(record: LogRecord) LogRecord[source]

Override to prevent log record mutation by the base class.

The base class mutates log entries before sending them to the queue. This method creates a shallow copy of the record, calculates the message, and returns the copy.

Parameters:

record (LogRecord) – The log record to be prepared.

Returns:

A shallow copy of the record with the message attribute set.

Return type:

LogRecord