Skip to content

Commit

Permalink
Note about step debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulVanSchayck committed Jun 6, 2024
1 parent bfe0483 commit 8264c5d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# wp5-edr-workshop
# RODEO Work Package 5 - EDR Workshop

## Getting started

Expand All @@ -19,6 +19,16 @@ Run the API in debug mode using
uvicorn main:app --reload
```
This automatically reloads the API if you make any changes to the source.
It is also possible to start uvicorn directly using:

```shell
python3 main.py
```

## Step debugging

In Pycharm or Visual Studio Code, add `main.py` Python3 run configuration. This
will start uvicorn while still allowing to do step debugging inside the IDE.

## Visualization

Expand Down
6 changes: 5 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# For developing: uvicorn main:app --reload
import logging

import uvicorn
from brotli_asgi import BrotliMiddleware
from edr_pydantic.capabilities import ConformanceModel
from edr_pydantic.capabilities import Contact
Expand All @@ -20,7 +21,7 @@
def setup_logging():
logger = logging.getLogger()
syslog = logging.StreamHandler()
formatter = logging.Formatter("%(asctime)s ; e-soh-api ; %(process)s ; %(levelname)s ; %(name)s ; %(message)s")
formatter = logging.Formatter("%(asctime)s ; edr-api ; %(process)s ; %(levelname)s ; %(name)s ; %(message)s")

syslog.setFormatter(formatter)
logger.addHandler(syslog)
Expand Down Expand Up @@ -109,3 +110,6 @@ async def get_collection_metadata(request: Request) -> Collection:

# Include other routes
app.include_router(observations.router)

if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)

0 comments on commit 8264c5d

Please sign in to comment.