class_docstr: Custom StreamHandler used by the live logging feature: it will write a newline before the first log message
  in each test.
  
  During live logging we must also explicitly disable stdout/stderr capturing otherwise it will get captured
  and won't appear in the terminal.
class_docstr_tok: ["Custom","StreamHandler","used","by","the","live","logging","feature",":","it","will","write","a","newline","before","the","first","log","message","in","each","test",".","During","live","logging","we","must","also","explicitly","disable","stdout\/stderr","capturing","otherwise","it","will","get","captured","and","wo","n't","appear","in","the","terminal","."]
code: def emit(self, record):
      ctx_manager = (
          self.capture_manager.global_and_fixture_disabled()
          if self.capture_manager
          else dummy_context_manager()
      )
      with ctx_manager:
          if not self._first_record_emitted:
              self.stream.write("\n")
              self._first_record_emitted = True
          elif self._when in ("teardown", "finish"):
              if not self._test_outcome_written:
                  self._test_outcome_written = True
                  self.stream.write("\n")
          if not self._section_name_shown and self._when:
              self.stream.section(
                  "live log " + self._when, sep="-", bold=True
              )
              self._section_name_shown = True
          logging.StreamHandler.emit(self, record)
  
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 _LiveLoggingStreamHandler obj's underlying member method code with example usage: obj.emit(record) without return types