Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
samj committed Sep 13, 2024
1 parent 72ef184 commit bd78f04
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ def cleanup():
from app import create_app
app = create_app()

# Define host and port
host = "localhost"
port = 8443

# Log connection details
logger.info(f"You can access pAI-OS at https://{host}:{port}.")
logger.info("Bypass certificate warnings if using self-signed certificates.")

# Run the app
import uvicorn

Expand All @@ -50,8 +58,8 @@ def cleanup():
try:
uvicorn.run(
"app:create_app",
host="localhost",
port=8443,
host=host,
port=port,
factory=True,
workers=1,
reload=True,
Expand Down
12 changes: 10 additions & 2 deletions backend/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ def cleanup():
from app import create_app
app = create_app()

# Define host and port
host = "localhost"
port = 8443

# Log connection details
logger.info(f"You can access pAI-OS at https://{host}:{port}.")
logger.info("Bypass certificate warnings if using self-signed certificates.")

# Run the app
import uvicorn

Expand All @@ -51,8 +59,8 @@ def cleanup():
try:
uvicorn.run(
"app:create_app",
host="localhost",
port=8443,
host=host,
port=port,
factory=True,
workers=1,
reload=True,
Expand Down
2 changes: 1 addition & 1 deletion common/cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def check_cert(key_passphrase: str | None = None):
except Exception as e:
logger.error(f"Error generating certificate and key: {e}")
else:
logger.info(f"Certificate and key already exist at {cert_dir}")
logger.info(f"Using existing certificate and key.")

# Example usage
if __name__ == "__main__":
Expand Down

0 comments on commit bd78f04

Please sign in to comment.