mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 03:30:06 +00:00
fix: use loguru logger for public dir warnings (#1520)
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
Pre-commit / pre-commit (push) Waiting to run
Test / Run Python Tests (push) Waiting to run
Some checks are pending
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
Pre-commit / pre-commit (push) Waiting to run
Test / Run Python Tests (push) Waiting to run
This commit is contained in:
parent
65254b8839
commit
199b013044
1 changed files with 3 additions and 3 deletions
|
|
@ -99,12 +99,12 @@ public_dir = os.environ.get("PUBLIC_DIR") or os.path.join(os.path.dirname(__file
|
|||
if not os.path.isdir(public_dir):
|
||||
try:
|
||||
os.makedirs(public_dir, exist_ok=True)
|
||||
logger.warning(f"Public directory did not exist. Created: {public_dir}")
|
||||
loguru_logger.warning(f"Public directory did not exist. Created: {public_dir}")
|
||||
except Exception as e:
|
||||
logger.error(f"Public directory missing and could not be created: {public_dir}. Error: {e}")
|
||||
loguru_logger.error(f"Public directory missing and could not be created: {public_dir}. Error: {e}")
|
||||
public_dir = None
|
||||
|
||||
if public_dir and os.path.isdir(public_dir):
|
||||
api.mount("/public", StaticFiles(directory=public_dir), name="public")
|
||||
else:
|
||||
logger.warning("Skipping /public mount because public directory is unavailable")
|
||||
loguru_logger.warning("Skipping /public mount because public directory is unavailable")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue