title: I need log data for the detected objects in Python OpenCV
body: <p>How can I log the data from detecting an object or of face in Python OpenCV? I have not been able to find a way to do it successfully as of yet.</p>
  
  <p>Here is code that I added:</p>
  
  <pre><code>label = "{}: {:.2f}%".format(CLASSES[idx], confidence * 100)
  
  cv2.rectangle(frame, (startX, startY), (endX, endY), COLORS[idx], 2)
  
  y = startY - 15 if startY - 15 &gt; 15 else startY + 15
  cv2.putText(frame, label, (startX, y), cv2.FONT_HERSHEY_SIMPLEX, 0.5, COLORS[idx], 2)
  
  #print (label + "\n")
  print(label)
  </code></pre>
  
  <p>Now when I run this I do see the label of the category detected, but I need to get this out to a log file.</p>