<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def enqueue( self, record, message, resource=None, labels=None, trace=None, span_id=None ):
 """Queues a log entry to be written by the background thread. :type record: :class:`logging.LogRecord` :param record: Python log record that the handler was called with. :type message: str :param message: The message from the ``LogRecord`` after being formatted by the associated log formatters. :type resource: :class:`~google.cloud.logging.resource.Resource` :param resource: (Optional) Monitored resource of the entry :type labels: dict :param labels: (Optional) Mapping of labels for the entry. :type trace: str :param trace: (optional) traceid to apply to the logging entry. :type span_id: str :param span_id: (optional) span_id within the trace for the log entry. Specify the trace parameter if span_id is set. """

        self._queue.put_nowait(
            {
                "info": {"message": message, "python_logger": record.name},
                "severity": record.levelname,
                "resource": resource,
                "labels": labels,
                "trace": trace,
                "span_id": span_id,
            }
        )