Skip to content

Commit 7ab5f3e

Browse files
authored
Remove 'R2R_PR2R_PROJECT_NAME' print out (SciPhi-AI#2000)
1 parent 88c3b1a commit 7ab5f3e

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

py/core/main/app_entry.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import os
21
import logging
2+
import os
33
from contextlib import asynccontextmanager
44
from typing import Optional
55

@@ -81,16 +81,17 @@ async def create_r2r_app(
8181
)
8282
logging.info(f"Environment R2R_PROJECT_NAME: {os.getenv('R2R_PROJECT_NAME')}")
8383

84-
logging.info(f"Environment R2R_POSTGRES_HOST: {os.getenv('R2R_POSTGRES_HOST')}")
84+
logging.info(
85+
f"Environment R2R_POSTGRES_HOST: {os.getenv('R2R_POSTGRES_HOST')}"
86+
)
8587
logging.info(
8688
f"Environment R2R_POSTGRES_DBNAME: {os.getenv('R2R_POSTGRES_DBNAME')}"
8789
)
88-
logging.info(f"Environment R2R_POSTGRES_PORT: {os.getenv('R2R_POSTGRES_PORT')}")
8990
logging.info(
90-
f"Environment R2R_POSTGRES_PASSWORD: {os.getenv('R2R_POSTGRES_PASSWORD')}"
91+
f"Environment R2R_POSTGRES_PORT: {os.getenv('R2R_POSTGRES_PORT')}"
9192
)
9293
logging.info(
93-
f"Environment R2R_PROJECT_NAME: {os.getenv('R2R_PR2R_PROJECT_NAME')}"
94+
f"Environment R2R_POSTGRES_PASSWORD: {os.getenv('R2R_POSTGRES_PASSWORD')}"
9495
)
9596

9697
# Create the FastAPI app

py/core/utils/logging_config.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ def filter(self, record: logging.LogRecord) -> bool:
7171

7272

7373
log_level = os.environ.get("R2R_LOG_LEVEL", "INFO").upper()
74-
log_console_formatter = os.environ.get("R2R_LOG_CONSOLE_FORMATTER", "colored").lower() # colored or json
74+
log_console_formatter = os.environ.get(
75+
"R2R_LOG_CONSOLE_FORMATTER", "colored"
76+
).lower() # colored or json
7577

7678
log_dir = Path.cwd() / "logs"
7779
log_dir.mkdir(exist_ok=True)
@@ -104,8 +106,12 @@ def filter(self, record: logging.LogRecord) -> bool:
104106
},
105107
"json": {
106108
"()": "pythonjsonlogger.json.JsonFormatter",
107-
"format": "%(name)s %(levelname)s %(message)s", # these become keys in the JSON log
108-
"rename_fields": {"asctime": "time", "levelname": "level", "name": "logger"},
109+
"format": "%(name)s %(levelname)s %(message)s", # these become keys in the JSON log
110+
"rename_fields": {
111+
"asctime": "time",
112+
"levelname": "level",
113+
"name": "logger",
114+
},
109115
},
110116
},
111117
"handlers": {
@@ -149,6 +155,7 @@ def filter(self, record: logging.LogRecord) -> bool:
149155
},
150156
}
151157

158+
152159
def configure_logging() -> Path:
153160
logging.config.dictConfig(log_config)
154161

0 commit comments

Comments
 (0)