code: def get_logging_func(
      logger: Logger,
  ) -> Optional[Callable[[int, str, int, str], None]]:
      """Get the logging function.
  
      Parameters
      ----------
      logger : Logger
          The logger instance.
      Returns
      -------
      result : Optional[Callable]
          The function to do the specified level of logging.
      """
      if logger is None:
          return None
  
      level2log = {
          logging.DEBUG: logger.debug,
          logging.INFO: logger.info,
          logging.WARNING: logger.warning,
          logging.ERROR: logger.error,
          # logging.FATAL not included
      }
  
      def logging_func(level: int, filename: str, lineo: int, msg: str):
          if level < 0:  # clear the output in notebook / console
              from IPython.display import (  # type: ignore # pylint: disable=import-outside-toplevel
                  clear_output,
              )
  
              clear_output(wait=True)
          else:
              level2log[level](
                  f"[{os.path.basename(filename)}:{lineo}] " + msg
              )
  
      return logging_func
  
file_path: tvm/python/tvm/meta_schedule/logging.py
imports: import logging
  import logging.config
  import os
  import os.path
  from logging import Logger
  from typing import Any, Callable, Dict, List, Optional
label_desc: Use image node_id 2 for calling a global function with example usage: get_logging_func(logger) and returns: logging_func, None