forked from open-webui/open-webui
Migrate to python logging module with env var control.
This commit is contained in:
parent
d865b9fe59
commit
e6dd0bfbe0
15 changed files with 174 additions and 82 deletions
|
@ -25,9 +25,12 @@ from pathlib import Path
|
|||
import uuid
|
||||
import base64
|
||||
import json
|
||||
import logging
|
||||
|
||||
from config import CACHE_DIR, AUTOMATIC1111_BASE_URL
|
||||
from config import SRC_LOG_LEVELS, CACHE_DIR, AUTOMATIC1111_BASE_URL
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
log.setLevel(SRC_LOG_LEVELS["IMAGES"])
|
||||
|
||||
IMAGE_CACHE_DIR = Path(CACHE_DIR).joinpath("./image/generations/")
|
||||
IMAGE_CACHE_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
@ -268,7 +271,7 @@ def save_b64_image(b64_str):
|
|||
|
||||
return image_id
|
||||
except Exception as e:
|
||||
print(f"Error saving image: {e}")
|
||||
log.error(f"Error saving image: {e}")
|
||||
return None
|
||||
|
||||
|
||||
|
@ -341,7 +344,7 @@ def generate_image(
|
|||
|
||||
res = r.json()
|
||||
|
||||
print(res)
|
||||
log.debug(f"res: {res}")
|
||||
|
||||
images = []
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue