title: Add logs in junit xml from pytest_generate_tests method
body: <p>I'm working with Jenkins which parses the Junit XML. Any developer would also look at the Jenkins failure for triaging purpose. That means all the logs should be available in Junit xml. </p>
  
  <p>The issue is that the method pytest_generate_tests has a very big implementation and requires log messages for troubleshooting purpose. </p>
  
  <p>However, the log messages added in pytest_generate_tests does not appear in Junit xml. Is there a way to include the log messages in Junit xml if the test discovery was failed? </p>
  
  <p>The command I'm providing</p>
  
  <pre><code>pytest -vv --log-level=INFO --junit-xml=sample.xml
  </code></pre>
  
  <p>pytest.ini (added junit_logging in a hope that Junit_xml will include the logs)</p>
  
  <pre><code>[pytest]
  junit_logging = all
  </code></pre>
  
  <p>my sample Junit.xml  (Without any logs related to pytest_generate_tests )</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;testsuites&gt;
  &lt;testsuite errors="1" failures="0" hostname="W117-JayJ" name="pytest" skipped="0" tests="1" time="0.960" timestamp="2020-04-12T10:27:31.178617"&gt;
  &lt;testcase classname="tests.test_my_addon" file="tests/test_my_addon.py" name="Test_App" time="0.000"&gt;&lt;error message="collection failure"&gt;pyparallel\lib\site-packages\pluggy\hooks.py:286: in __call__
      return self._hookexec(self, self.get_hookimpls(), kwargs
  
      . . . a Big stack trace . . .
      raise Exception(&amp;quot;This is a random Failure &amp;quot;)
  E   Exception: This is a random Failure &lt;/error&gt;
  &lt;/testcase&gt;
  &lt;/testsuite&gt;
  &lt;/testsuites&gt;
  </code></pre>
  
  <p>There's no log messages attatched in the Junit xml. </p>
  
  <p>I can look at the logs in the console after "collecting ..."</p>
  
  <pre><code>========================================================================================== test session starts ==========================================================================================
  platform win32 -- Python 3.7.4, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
  rootdir: C:\Jay\Work\Automation\pytest-sample-addon\new_dev_environment, inifile: pytest.ini, testpaths: tests
  plugins: lovely-pytest-docker-0.1.0, forked-1.1.3, xdist-1.31.0, sample-addon-0.1.0
  collecting ... generating testcases for app. fixture=app_positive_cases
  generating field tests..
  collected 0 items / 1 error
  </code></pre>
  
  <p>Is there a way to handle the logs properly in the console and add it to Junit.xml as well?</p>