code: def write_captured_output(self, report):
      if not self.xml.log_passing_tests and report.passed:
          return
  
      content_out = report.capstdout
      content_log = report.caplog
      content_err = report.capstderr
  
      if content_log or content_out:
          if content_log and self.xml.logging == "system-out":
              if content_out:
                  # syncing stdout and the log-output is not done yet. It's
                  # probably not worth the effort. Therefore, first the captured
                  # stdout is shown and then the captured logs.
                  content = "\n".join(
                      [
                          " Captured Stdout ".center(80, "-"),
                          content_out,
                          "",
                          " Captured Log ".center(80, "-"),
                          content_log,
                      ]
                  )
              else:
                  content = content_log
          else:
              content = content_out
  
          if content:
              tag = getattr(Junit, "system-out")
              self.append(tag(bin_xml_escape(content)))
  
      if content_log or content_err:
          if content_log and self.xml.logging == "system-err":
              if content_err:
                  content = "\n".join(
                      [
                          " Captured Stderr ".center(80, "-"),
                          content_err,
                          "",
                          " Captured Log ".center(80, "-"),
                          content_log,
                      ]
                  )
              else:
                  content = content_log
          else:
              content = content_err
  
          if content:
              tag = getattr(Junit, "system-err")
              self.append(tag(bin_xml_escape(content)))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import os
  import platform
  import re
  import sys
  import time
  from datetime import datetime
  import py
  import six
  import pytest
  from _pytest import nodes
  from _pytest.config import filename_arg
label_desc: Use image node_id 9 for calling the _NodeReporter obj's underlying member method code with example usage: obj.write_captured_output(report) without return types