class_docstr: Fake file-like stream object that redirects writes to a logger instance.
class_docstr_tok: ["Fake","file-like","stream","object","that","redirects","writes","to","a","logger","instance","."]
code: def write(self, buf):
      temp_linebuf = self.linebuf + buf
      self.linebuf = ""
      for line in temp_linebuf.splitlines(True):
          # From the io.TextIOWrapper docs:
          #   On output, if newline is None, any '\n' characters written
          #   are translated to the system default line separator.
          # By default sys.stdout.write() expects '\n' newlines and then
          # translates them so this is still cross platform.
          if line[-1] == "\n":
              self.logger.log(self.log_level, line.rstrip())
          else:
              self.linebuf += line
  
file_path: llmga/llmga/llava/utils.py
imports: import datetime
  import logging
  import logging.handlers
  import os
  import sys
  import requests
  from llmga.llava.constants import LOGDIR
label_desc: Use image node_id 3 for calling the StreamToLogger obj's underlying member method code with example usage: obj.write(buf) without return types