def init_logging(<EOL>log_dir=tempfile.gettempdir(),<EOL>format="<STR_LIT>",<EOL>level=logging.INFO,<EOL>):
if not Meta.log_path:<EOL><INDENT>dt = datetime.now().strftime("<STR_LIT>")<EOL>log_path = os.path.join(log_dir, dt)<EOL>if not os.path.exists(log_path):<EOL><INDENT>os.makedirs(log_path)<EOL><DEDENT>logging.basicConfig(<EOL>format=format,<EOL>level=level,<EOL>handlers=[<EOL>logging.FileHandler(os.path.join(log_path, "<STR_LIT>")),<EOL>logging.StreamHandler(),<EOL>],<EOL>)<EOL>logger.info(f"<STR_LIT>")<EOL>Meta.log_path = log_path<EOL><DEDENT>else:<EOL><INDENT>logger.info(<EOL>f"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>
Configures logging to output to the provided log_dir.

    Will use a nested directory whose name is the current timestamp.

    :param log_dir: The directory to store logs in.
    :type log_dir: str
    :param format: The logging format string to use.
    :type format: str
    :param level: The logging level to use, e.g., logging.INFO.