code: def _cached_log_stream(filename):
      # we tune the buffering value so that the logs are updated
      # frequently.
      log_buffer_kb = 10 * 1024  # 10KB
      io = g_pathmgr.open(filename, mode="a", buffering=log_buffer_kb)
      atexit.register(io.close)
      return io
  
file_path: vissl/vissl/utils/logger.py
imports: import atexit
  import functools
  import logging
  import subprocess
  import sys
  from iopath.common.file_io import g_pathmgr
  from vissl.utils.io import makedir
label_desc: Use image node_id 2 for calling a global function with example usage: _cached_log_stream(filename) and returns: io