fix(builder): logging issues

This commit is contained in:
BennyKok 2024-01-11 12:38:54 +08:00
parent a4b8dbf1d3
commit d978658301
2 changed files with 8 additions and 5 deletions

View File

@ -3,6 +3,8 @@ import requests
import time
import subprocess
print("Starting ComfyUI")
command = ["python", "main.py", "--disable-auto-launch", "--disable-metadata", "--cpu"]
# Start the server
server_process = subprocess.Popen(command, cwd="/comfyui")

View File

@ -6,7 +6,8 @@ import asyncio
import logging
# Set up the logger
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format='%(message)s')
logger = logging.getLogger("restore_snapshot")
# Start the server
# server_process = subprocess.Popen(command, cwd="/comfyui", stdout=subprocess.PIPE)
@ -47,19 +48,19 @@ async def read_stream(stream, isStderr):
continue
if not isStderr:
logging.info(l)
logger.info(l)
# If the output matches one of the messages, print it and break the loop
if success_message in l:
logging.info("Snapshot restore succeeded.")
logger.info("Snapshot restore succeeded.")
break
elif failure_message in l:
logging.info("Snapshot restore failed.")
logger.info("Snapshot restore failed.")
break
else:
# is error
# logger.error(l)
logging.error(l)
logger.error(l)
break
else: