def get_records(self, when):
handler = self._item.catch_log_handlers.get(when)<EOL>if handler:<EOL><INDENT>return handler.records<EOL><DEDENT>else:<EOL><INDENT>return []<EOL><DEDENT>
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