code: def enable_log_config(config: "towhee.config.LogConfig" = None):
      if not config:
          config = LogConfig()
  
      time_rotating_handler = _get_time_file_hdlr(config)
      size_rotating_handler = _get_size_file_hdlr(config)
      console_handler = _get_console_hdlr(config)
  
      if config.mode == "console":
          _config_logger(root_log, console_handler)
          root_log.setLevel(config.stream_level)
      elif config.mode == "file":
          if config.rotate_mode == "size":
              _config_logger(root_log, size_rotating_handler)
          elif config.rotate_mode == "time":
              _config_logger(root_log, time_rotating_handler)
          else:
              raise ValueError(
                  f"value should be either 'time' or 'size', not '{config.rotate_mode}'."
              )
          root_log.setLevel(config.file_level)
      else:
          raise ValueError(
              f"value should be either 'console' or 'file', not '{config.mode}'."
          )
  
imports: import logging
  from towhee.config.log_config import LogConfig
label_desc: Use image node_id 5 for calling a global function with example usage: enable_log_config(config) without return types