code: def start_experiment_logging(
      experiment_id: str, log_file: Path, level: str
  ) -> None:
      """
      Register the log file handler for an experiment's ``experiment.log``.
  
      This function should be invoked on starting experiment.
      We don't want to create the experiment folder if the user does not launch it.
  
      If there are multiple experiments running concurrently,
      log messages will be written to all running experiments' log files.
  
      It is safe to call it multiple times.
      """
      if experiment_id in _handlers:
          return
  
      handler = FileHandler(log_file, encoding="utf_8")
      handler.setFormatter(_LogFileFormatter())
      handler.setLevel(level.upper())
  
      _handlers[experiment_id] = handler
      _root_logger.addHandler(handler)
  
imports: from __future__ import annotations
  import logging
  import sys
  from datetime import datetime
  from io import TextIOBase
  from logging import FileHandler, Formatter, Handler, LogRecord, Logger, StreamHandler
  from pathlib import Path
  import string
  from typing import Optional
  import colorama
  from .env_vars import dispatcher_env_vars, trial_env_vars
label_desc: Use image node_id 3 for calling a global function with example usage: start_experiment_logging(experiment_id, log_file, level) without return types