class_docstr: Provides access and control of log capturing.
class_docstr_tok: ["Provides","access","and","control","of","log","capturing","."]
docstr: Get the logging records for one of the possible test phases.
  
  :param str when:
      Which test phase to obtain the records from. Valid values are: "setup", "call" and "teardown".
  
  :rtype: List[logging.LogRecord]
  :return: the list of captured records at the given stage
  
  .. versionadded:: 3.4
docstr_tok: ["Get","the","logging","records","for","one","of","the","possible","test","phases",".",":","param","str","when",":","Which","test","phase","to","obtain","the","records","from",".","Valid","values","are",":","``","setup","''",",","``","call","''","and","``","teardown","''",".",":","rtype",":","List","[","logging.LogRecord","]",":","return",":","the","list","of","captured","records","at","the","given","stage","..","versionadded",":",":","3.4"]
code: def get_records(self, when):
      """
      Get the logging records for one of the possible test phases.
  
      :param str when:
          Which test phase to obtain the records from. Valid values are: "setup", "call" and "teardown".
  
      :rtype: List[logging.LogRecord]
      :return: the list of captured records at the given stage
  
      .. versionadded:: 3.4
      """
      handler = self._item.catch_log_handlers.get(when)
      if handler:
          return handler.records
      else:
          return []
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import re
  from contextlib import contextmanager
  import py
  import six
  import pytest
  from _pytest.compat import dummy_context_manager
  from _pytest.config import create_terminal_writer
  from _pytest.pathlib import Path
label_desc: Use image node_id 4 for calling the LogCaptureFixture obj's underlying member method code with example usage: obj.get_records(when) and returns: handler, list