Skip to content

Commit eda798d

Browse files
mslwangebwu95
authored andcommitted
Update READMEs
1 parent 8fb87a8 commit eda798d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,18 @@ pdm run ruff format .
243243

244244
All code needs to pass ruff formatting and linting before it can be merged.
245245

246+
### Logging
247+
248+
To add a logger to a new service or file, use the `LOGGER_NAME` function in `app/utilities/constants.py`
249+
250+
```python
251+
from app.utilities.constants import LOGGER_NAME
252+
253+
log = logging.getLogger(LOGGER_NAME("my_service"))
254+
```
255+
256+
If you'd like to create a new logger name in the hierarchy, you'll need to add it to `alembic.ini` under the logger section. Following the pre-existing examples for `logger_uvicorn` for example.
257+
246258
### Frontend
247259

248260
#### Prettier

backend/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,15 @@ To apply the migration, run the following command:
136136
```bash
137137
pdm run alembic upgrade head
138138
```
139+
140+
### Logging
141+
142+
To add a logger to a new service or file, use the `LOGGER_NAME` function in `app/utilities/constants.py`
143+
144+
```python
145+
from app.utilities.constants import LOGGER_NAME
146+
147+
log = logging.getLogger(LOGGER_NAME("my_service"))
148+
```
149+
150+
If you'd like to create a new logger name in the hierarchy, you'll need to add it to `alembic.ini` under the logger section. Following the pre-existing examples for `logger_uvicorn` for example.

0 commit comments

Comments
 (0)