class_docstr: Writer allowing redirection of streams to logger methods.
class_docstr_tok: ["Writer","allowing","redirection","of","streams","to","logger","methods","."]
code: def write(self, message: str):
      self._msg = self._msg + message
      while "\n" in self._msg:
          pos = self._msg.find("\n")
          self._writer(self._msg[:pos])
          self._msg = self._msg[pos + 1 :]
  
imports: import logging
  import os
  import traceback
  import warnings
  from contextlib import redirect_stderr, redirect_stdout
  from typing import Callable, Optional, Union
label_desc: Use image node_id 2 for calling the LoggerWriter obj's underlying member method code with example usage: obj.write(message) without return types