code: def install(self, debug=False):
      if debug or self.config is None:
          level = os.getenv("DEBUG_MODE_LOG_LEVEL", "DEBUG")
          try:
              import rich.logging
  
              logging_class = "rich.logging.RichHandler"
              logging_formatters = {}
              handlers = {
                  "console": {
                      "class": logging_class,
                      "level": level,
                      "filters": [],
                  }
              }
          except ImportError:
              logging_class = "logging.StreamHandler"
              logging_formatters = {
                  "console": {
                      "format": "[%(levelname)s][%(asctime)-8s][%(process)s][%(module)s.%(funcName)s][line:%(lineno)d]: %(message)s"
                  }
              }
              handlers = {
                  "console": {
                      "class": logging_class,
                      "level": level,
                      "formatter": "console",
                  }
              }
          self.config = dict(
              version=1,
              formatters=logging_formatters,
              handlers=handlers,
              filters={},
              loggers={},
              root=dict(handlers=["console"], level="DEBUG"),
              disable_existing_loggers=False,
          )
  
      for _name, _conf in self.config.get("handlers", {}).items():
          if _conf.get("filename"):
              os.makedirs(
                  os.path.dirname(_conf.get("filename")), exist_ok=True
              )
      logging.config.dictConfig(self.config)
  
file_path: FATE/python/fate/components/core/spec/logger.py
imports: import logging
  import logging.config
  import os
  from typing import Optional
  import pydantic
label_desc: Use image node_id 1 for calling the LoggerConfig obj's underlying member method code with example usage: obj.install(debug) without return types