Skip to content

Commit d8ec0bc

Browse files
committed
Update READMEs
1 parent 3f5fc1b commit d8ec0bc

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
@@ -235,6 +235,18 @@ pdm run ruff format .
235235

236236
All code needs to pass ruff formatting and linting before it can be merged.
237237

238+
### Logging
239+
240+
To add a logger to a new service or file, use the `LOGGER_NAME` function in `app/utilities/constants.py`
241+
242+
```python
243+
from app.utilities.constants import LOGGER_NAME
244+
245+
log = logging.getLogger(LOGGER_NAME("my_service"))
246+
```
247+
248+
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.
249+
238250
### Frontend
239251

240252
#### 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)