class_docstr: Tests for logging integration
docstr: Test logging of QNode with parameterised gradients
code: def test_dq_qnode_execution_grad(
      self, caplog, diff_method, num_records
  ):
      "Test logging of QNode with parameterised gradients"
  
      enable_and_configure_logging()
  
      dev = qml.device("default.qubit", wires=2)
      params = qml.numpy.array(0.1234)
  
      # Single log entry, QNode creation
      with caplog.at_level(logging.DEBUG):
          dev = qml.device("default.qubit", wires=2)
          params = qml.numpy.array(0.1234)
  
          @qml.qnode(dev, diff_method=diff_method)
          def circuit(params):
              qml.RX(params, wires=0)
              return qml.expval(qml.PauliZ(0))
  
          qml.grad(circuit)(params)
  
      assert len(caplog.records) == num_records
  
      log_records_expected = [
          (
              "pennylane.workflow.qnode",
              [
                  "Creating QNode(func=<function TestLogging.test_dq_qnode_execution_grad",
                  "device=<default.qubit device (wires=2)",
                  f"interface=auto, diff_method={diff_method}, expansion_strategy=gradient, max_expansion=10, grad_on_execution=best,",
              ],
          ),
          (
              "pennylane.workflow.execution",
              [
                  "Entry with args=(tapes=(<QuantumScript: wires=[0], params=1>,)",
                  _grad_log_map[diff_method],
              ],
          ),
      ]
  
      for expected, actual in zip(
          log_records_expected, caplog.records[:2]
      ):
          assert expected[0] in actual.name
          assert all(msg in actual.getMessage() for msg in expected[1])
  
file_path: pennylane/tests/logging/test_logging_autograd.py
imports: import logging
  import pytest
  import pennylane
  import pennylane.logging
label_desc: Use image node_id 3 for calling the TestLogging obj's underlying member method code with example usage: obj.test_dq_qnode_execution_grad(caplog, diff_method, num_records) and returns: qml