fix(builder): logging issues
This commit is contained in:
parent
a4b8dbf1d3
commit
d978658301
@ -3,6 +3,8 @@ import requests
|
|||||||
import time
|
import time
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
print("Starting ComfyUI")
|
||||||
|
|
||||||
command = ["python", "main.py", "--disable-auto-launch", "--disable-metadata", "--cpu"]
|
command = ["python", "main.py", "--disable-auto-launch", "--disable-metadata", "--cpu"]
|
||||||
# Start the server
|
# Start the server
|
||||||
server_process = subprocess.Popen(command, cwd="/comfyui")
|
server_process = subprocess.Popen(command, cwd="/comfyui")
|
||||||
|
@ -6,7 +6,8 @@ import asyncio
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
# Set up the logger
|
# 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
|
# Start the server
|
||||||
# server_process = subprocess.Popen(command, cwd="/comfyui", stdout=subprocess.PIPE)
|
# server_process = subprocess.Popen(command, cwd="/comfyui", stdout=subprocess.PIPE)
|
||||||
@ -47,19 +48,19 @@ async def read_stream(stream, isStderr):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if not isStderr:
|
if not isStderr:
|
||||||
logging.info(l)
|
logger.info(l)
|
||||||
|
|
||||||
# If the output matches one of the messages, print it and break the loop
|
# If the output matches one of the messages, print it and break the loop
|
||||||
if success_message in l:
|
if success_message in l:
|
||||||
logging.info("Snapshot restore succeeded.")
|
logger.info("Snapshot restore succeeded.")
|
||||||
break
|
break
|
||||||
elif failure_message in l:
|
elif failure_message in l:
|
||||||
logging.info("Snapshot restore failed.")
|
logger.info("Snapshot restore failed.")
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# is error
|
# is error
|
||||||
# logger.error(l)
|
# logger.error(l)
|
||||||
logging.error(l)
|
logger.error(l)
|
||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user