Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,14 @@ import logging
|
|
| 5 |
from uuid import uuid4
|
| 6 |
from simple_salesforce import Salesforce
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
SALESFORCE_USERNAME = "vaneshdevarapalli866@agentforce.com"
|
| 9 |
SALESFORCE_PASSWORD = "vanesh@331"
|
| 10 |
SALESFORCE_SECURITY_TOKEN = "VRUVbBOdG0s9Q4xy0W6DB1Y6b"
|
| 11 |
|
| 12 |
-
|
| 13 |
def connect_to_salesforce():
|
| 14 |
try:
|
| 15 |
sf_instance = Salesforce(
|
|
@@ -26,10 +29,6 @@ def connect_to_salesforce():
|
|
| 26 |
|
| 27 |
sf = connect_to_salesforce()
|
| 28 |
|
| 29 |
-
# Configure logging
|
| 30 |
-
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 31 |
-
logger = logging.getLogger(__name__)
|
| 32 |
-
|
| 33 |
# FastAPI endpoint
|
| 34 |
FASTAPI_ENDPOINT = "http://localhost:8000/predict"
|
| 35 |
|
|
@@ -210,4 +209,4 @@ if __name__ == "__main__":
|
|
| 210 |
try:
|
| 211 |
app.launch(debug=False, share=False)
|
| 212 |
except Exception as e:
|
| 213 |
-
logger.error(f"Failed to launch Gradio app: {e}")
|
|
|
|
| 5 |
from uuid import uuid4
|
| 6 |
from simple_salesforce import Salesforce
|
| 7 |
|
| 8 |
+
# Configure logging AT THE TOP before usage
|
| 9 |
+
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
| 10 |
+
logger = logging.getLogger(__name__)
|
| 11 |
+
|
| 12 |
SALESFORCE_USERNAME = "vaneshdevarapalli866@agentforce.com"
|
| 13 |
SALESFORCE_PASSWORD = "vanesh@331"
|
| 14 |
SALESFORCE_SECURITY_TOKEN = "VRUVbBOdG0s9Q4xy0W6DB1Y6b"
|
| 15 |
|
|
|
|
| 16 |
def connect_to_salesforce():
|
| 17 |
try:
|
| 18 |
sf_instance = Salesforce(
|
|
|
|
| 29 |
|
| 30 |
sf = connect_to_salesforce()
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
# FastAPI endpoint
|
| 33 |
FASTAPI_ENDPOINT = "http://localhost:8000/predict"
|
| 34 |
|
|
|
|
| 209 |
try:
|
| 210 |
app.launch(debug=False, share=False)
|
| 211 |
except Exception as e:
|
| 212 |
+
logger.error(f"Failed to launch Gradio app: {e}")
|