configure_logging_and_launch_listener(host, …)


Context manager to run in temporary directory




Filter class that adds hostid information to logging records.

LogRecordSocketReceiver(host, abort_queue, …)

Simple TCP socket-based logging receiver.

LogRecordStreamHandler(request, …)

Handler for a streaming logging request.

class meld.util.HostNameContextFilter(hostid)[source]

Filter class that adds hostid information to logging records.


Determine if the specified record is to be logged.

Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place.

class meld.util.LogRecordSocketReceiver(host, abort_queue, socket_queue, handler=<class 'meld.util.LogRecordStreamHandler'>)[source]

Simple TCP socket-based logging receiver.

The configure_logging_and_launch_listener function should be launched in another process. The socket number can be retrieved from socket_queue and the logger can be told to abort through the abort_queue.


Called to clean up an individual request.


Return socket file number.

Interface required by selector.

finish_request(request, client_address)

Finish one request by instantiating RequestHandlerClass.


Get the request and client address from the socket.

May be overridden.

handle_error(request, client_address)

Handle an error gracefully. May be overridden.

The default is to print a traceback and continue.


Handle one request, possibly blocking.

Respects self.timeout.


Called if no new request arrives within self.timeout.

Overridden by ForkingMixIn.

process_request(request, client_address)

Start a new thread to process the request.

process_request_thread(request, client_address)

Same as in BaseServer but as a thread.

In addition, exception handling is done here.


Handle one request at a time until shutdown.

Polls for shutdown every poll_interval seconds. Ignores self.timeout. If you need to do periodic tasks, do them in another thread.


Called by constructor to activate the server.

May be overridden.


Called by constructor to bind the socket.

May be overridden.


Called by the serve_forever() loop.

May be overridden by a subclass / Mixin to implement any code that needs to be run during the loop.


Stops the serve_forever loop.

Blocks until the loop has finished. This must be called while serve_forever() is running in another thread, or it will deadlock.


Called to shutdown and close an individual request.

verify_request(request, client_address)

Verify the request. May be overridden.

Return True if we should proceed with this request.

class meld.util.LogRecordStreamHandler(request, client_address, server)[source]

Handler for a streaming logging request.

This basically logs the record using whatever logging policy is configured locally.


Handle multiple requests - each expected to be a 4-byte length, followed by the LogRecord in pickle format. Logs the record according to whatever policy is configured locally.


Context manager to run in temporary directory