code: def register_log(filename, level="DEBUG"):
      """Registers file to have logs written to.
  
      Args:
          filename: A string that is the filepath to log to, or sys.stderr/sys.stdout.
          level: Logging level. For example, "DEBUG".
  
      Returns:
          Logging handler.
      """
      import logging
      import logging.handlers
  
      if filename is sys.stderr or filename is sys.stdout:
          handler = logging.StreamHandler(stream=filename)
      else:
          handler = logging.handlers.WatchedFileHandler(filename)
  
      formatter = logging.Formatter(
          "%(asctime)s | %(filename)-20s %(lineno)-4s %(funcName)25s() | %(message)s"
      )
      handler.setFormatter(formatter)
  
      root = logging.getLogger("interpret")
      root.setLevel(level)
      root.addHandler(handler)
  
      return handler
  
file_path: interpret/python/interpret-core/interpret/develop.py
imports: import sys
label_desc: Use image node_id 7 for calling a global function with example usage: register_log(filename, level) and returns: handler