Skip to content

Commit

Permalink
Merge pull request #214 from ecmwf-projects/COPDS-2114-pass-logger-to…
Browse files Browse the repository at this point in the history
…-adaptor

Pass retrieve-api logger to the adaptor instance
  • Loading branch information
mcucchi9 authored Oct 2, 2024
2 parents 427fd7e + 8e06358 commit 1cac9f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cads_processing_api_service/adaptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

import cads_adaptors
import cads_catalogue.database
import structlog

DEFAULT_ENTRY_POINT = "cads_adaptors:UrlCdsAdaptor"

logger: structlog.stdlib.BoundLogger = structlog.get_logger(__name__)


def get_adaptor_properties(
dataset: cads_catalogue.database.Resource,
Expand Down Expand Up @@ -94,7 +97,9 @@ def instantiate_adaptor(
setup_code=adaptor_properties["setup_code"],
)
adaptor = adaptor_class(
form=adaptor_properties["form"], **adaptor_properties["config"]
form=adaptor_properties["form"],
**adaptor_properties["config"],
context=cads_adaptors.Context(logger=logger),
)

return adaptor

0 comments on commit 1cac9f3

Please sign in to comment.