ship_log_func and queue_log_func now accept a single string argument; implemented handle_queues()