Skip to content

Commit

Permalink
Configure logging in main module
Browse files Browse the repository at this point in the history
  • Loading branch information
TheByronHimes committed Jan 2, 2024
1 parent 2b38843 commit bb480d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mass/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#
"""Top-level functionality for the microservice"""
from ghga_service_commons.api import run_server
from hexkit.log import configure_logging

from mass.config import Config
from mass.inject import prepare_event_subscriber, prepare_rest_app
Expand All @@ -23,6 +24,7 @@
async def run_rest_app():
"""Run the HTTP REST API."""
config = Config() # type: ignore [call-arg]
configure_logging(config=config)

async with prepare_rest_app(config=config) as app:
await run_server(app=app, config=config)
Expand All @@ -31,6 +33,7 @@ async def run_rest_app():
async def consume_events(run_forever: bool = True):
"""Run the event consumer"""
config = Config() # type: ignore[call-arg]
configure_logging(config=config)

async with prepare_event_subscriber(config=config) as event_subscriber:
await event_subscriber.run(forever=run_forever)

0 comments on commit bb480d3

Please sign in to comment.