docstr: Add a FileHandler to logger that logs all WARNING and higher messages to a file. If the logger had a
  MemoryHandler at self._handlers["memory_err"], those buffered messages are flushed to the new file, and the
  MemoryHandler is closed.
docstr_tok: ["Add","a","FileHandler","to","logger","that","logs","all","WARNING","and","higher","messages","to","a","file",".","If","the","logger","had","a","MemoryHandler","at","self._handlers","[","``","memory_err","''","]",",","those","buffered","messages","are","flushed","to","the","new","file",",","and","the","MemoryHandler","is","closed","."]
code: def add_err_file_handler(self, log_file):
      """Add a FileHandler to logger that logs all WARNING and higher messages to a file. If the logger had a
      MemoryHandler at self._handlers["memory_err"], those buffered messages are flushed to the new file, and the
      MemoryHandler is closed."""
      if self._logger is None:
          raise RuntimeError(
              "Impossible to set handlers if the Logger is not predefined"
          )
  
      self._handlers["file_err"] = _logging.FileHandler(log_file)
      self._handlers["file_err"].addFilter(
          lambda record: record.levelno > _logging.INFO
      )
  
      formatter = BaseNeMoFormatter
      self._handlers["file_err"].setFormatter(formatter())
      self._logger.addHandler(self._handlers["file_err"])
  
      if self._handlers.get("memory_err", None):
          self._handlers["memory_err"].setTarget(
              self._handlers["file_err"]
          )
          self._handlers["memory_err"].close()  # flush and remove
          del self._handlers["memory_err"]
  
imports: import enum
  import logging
  import sys
  import threading
  import warnings
  from contextlib import contextmanager
  from logging.handlers import MemoryHandler
  from nemo.constants import NEMO_ENV_VARNAME_REDIRECT_LOGS_TO_STDERR, NEMO_ENV_VARNAME_TESTING
  from nemo.utils.env_var_parsing import get_envbool
  from nemo.utils.formatters.base import BaseNeMoFormatter, DebugNeMoFormatter
  from nemo.utils.get_rank import is_global_rank_zero
  from nemo.utils.metaclasses import Singleton
label_desc: Use image node_id 7 for calling the Logger obj's underlying member method code with example usage: obj.add_err_file_handler(log_file) without return types