defload_api_app(config,action:Callable):"""Load the API app, returning a callable `FastAPI` entrypoint."""logger=logger_get(name=config.LOGGER_NAME)logger_setlevel(name=config.LOGGER_NAME,loglevel=config.LOGGER_LEVEL)try:returnload_api_app_wrapper(config,action,logger)except(ValueError,ThreatPatrolsException)ase:logger.fatal(str(e))logger.debug("stack-trace",exc_info=e)exit(1)
defload_cli_app(config,action:Callable):"""Load the CLI app, returning a callable `CommandRouter` entrypoint."""logger=logger_get(name=config.LOGGER_NAME,with_request_id=False)logger_setlevel(name=config.LOGGER_NAME,loglevel=config.LOGGER_LEVEL)try:returnload_cli_app_wrapper(config,action)except(ValueError,ThreatPatrolsException,ValidationError)ase:logger.fatal(str(e))logger.debug("stack-trace",exc_info=e)exit(1)