class_docstr: Allowed patching a stream into the logger.
  Used for capturing and logging stdin and stderr when running in development mode pseudo worker.
class_docstr_tok: ["Allowed","patching","a","stream","into","the","logger",".","Used","for","capturing","and","logging","stdin","and","stderr","when","running","in","development","mode","pseudo","worker","."]
code: def __init__(
      self,
      stream,
      logger=None,
      level=logging.INFO,
      load_config_defaults=True,
  ):
      if (
          load_config_defaults
          and PrintPatchLogger.cr_flush_period is None
      ):
          PrintPatchLogger.cr_flush_period = config.get(
              "development.worker.console_cr_flush_period", 0
          )
      PrintPatchLogger.patched = True
      self._terminal = stream
      self._log = logger
      self._log_level = level
      self._cur_line = ""
      self._force_lf_flush = False
      self._lf_last_flush = 0
  
imports: import logging
  import sys
  from time import time
  from ..binding.frameworks import _patched_call
  from ..config import running_remotely, config, DEBUG_SIMULATE_REMOTE_TASK
  from ..utilities.process.mp import ForkSafeRLock
label_desc: Use image node_id 1 to create a new PrintPatchLogger object from inherited base classes: object with example: obj = PrintPatchLogger(stream, logger, level, load_config_defaults)