diff --git a/aea/aea_builder.py b/aea/aea_builder.py index 5461ec1dd5..0b043d98b6 100644 --- a/aea/aea_builder.py +++ b/aea/aea_builder.py @@ -880,12 +880,12 @@ def build(self, connection_ids: Optional[Collection[PublicId]] = None,) -> AEA: copy(self.private_key_paths), copy(self.connection_private_key_paths) ) identity = self._build_identity_from_wallet(wallet) - self._load_and_add_components(ComponentType.PROTOCOL, resources, identity) - self._load_and_add_components(ComponentType.CONTRACT, resources, identity) + self._load_and_add_components(ComponentType.PROTOCOL, resources, identity.name) + self._load_and_add_components(ComponentType.CONTRACT, resources, identity.name) self._load_and_add_components( ComponentType.CONNECTION, resources, - identity, + identity.name, identity=identity, crypto_store=wallet.connection_cryptos, ) @@ -910,7 +910,7 @@ def build(self, connection_ids: Optional[Collection[PublicId]] = None,) -> AEA: **deepcopy(self._context_namespace), ) self._load_and_add_components( - ComponentType.SKILL, resources, identity, agent_context=aea.context + ComponentType.SKILL, resources, identity.name, agent_context=aea.context ) self._build_called = True self._populate_contract_registry() @@ -1351,7 +1351,7 @@ def _load_and_add_components( self, component_type: ComponentType, resources: Resources, - aea_identity: Identity, + agent_name: str, **kwargs, ) -> None: """ @@ -1359,7 +1359,7 @@ def _load_and_add_components( :param component_type: the component type for which :param resources: the resources object to populate. - :param aea_identity: the identity of the AEA. + :param agent_name: the AEA name for logging purposes. :param kwargs: keyword argument to forward to the component loader. :return: None """ @@ -1376,7 +1376,7 @@ def _load_and_add_components( configuration = deepcopy(configuration) component = load_component_from_config(configuration, **kwargs) - _set_logger_to_component(component, configuration, aea_identity) + _set_logger_to_component(component, configuration, agent_name) resources.add_component(component) def _populate_contract_registry(self): @@ -1424,21 +1424,21 @@ def _check_we_can_build(self): def _set_logger_to_component( - component: Component, configuration: ComponentConfiguration, identity: Identity, + component: Component, configuration: ComponentConfiguration, agent_name: str, ) -> None: """ Set the logger to the component. :param component: the component instance. :param configuration: the component configuration - :param identity: the identity object of the AEA. + :param agent_name: the agent name :return: None """ if configuration.component_type == ComponentType.SKILL: # skip because skill object already have their own logger from the skill context. return logger_name = f"aea.packages.{configuration.author}.{configuration.component_type.to_plural()}.{configuration.name}" - logger = AgentLoggerAdapter(logging.getLogger(logger_name), identity.name) + logger = AgentLoggerAdapter(logging.getLogger(logger_name), agent_name) component.logger = logger diff --git a/packages/fetchai/connections/http_client/connection.py b/packages/fetchai/connections/http_client/connection.py index 0560858329..ce7f7f20ee 100644 --- a/packages/fetchai/connections/http_client/connection.py +++ b/packages/fetchai/connections/http_client/connection.py @@ -88,7 +88,6 @@ def __init__( self._tasks: Set[Task] = set() self.logger = logger - # TODO logger at this point is the module-level one, not with the agent name. self.logger.info("Initialised the HTTP client channel") async def connect(self, loop: AbstractEventLoop) -> None: diff --git a/packages/fetchai/connections/http_client/connection.yaml b/packages/fetchai/connections/http_client/connection.yaml index 316b33a890..5c05c1312c 100644 --- a/packages/fetchai/connections/http_client/connection.yaml +++ b/packages/fetchai/connections/http_client/connection.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 aea_version: '>=0.5.0, <0.6.0' fingerprint: __init__.py: QmPdKAks8A6XKAgZiopJzPZYXJumTeUqChd8UorqmLQQPU - connection.py: QmZVEzoHKi5qRabE3fWF1zJYphcU4frxJQo9dWXnbDV5RL + connection.py: QmVYurcnjuRTK6CnuEc6qNbSykmZEzRMkjyGhknJKzKRQt fingerprint_ignore_patterns: [] protocols: - fetchai/http:0.3.0 diff --git a/packages/hashes.csv b/packages/hashes.csv index 015790745e..5be3c0a96c 100644 --- a/packages/hashes.csv +++ b/packages/hashes.csv @@ -19,7 +19,7 @@ fetchai/agents/thermometer_client,QmbcVyNwpHAwY8NPcgd2bdDpGhLLZLTyg6o78o67RXrNC1 fetchai/agents/weather_client,QmemjFHEFE32mXjP48NEX7prqaAHfW9wTM8mBAPfM4dUeA fetchai/agents/weather_station,QmQ8vVjVB4xDqjZwd5SH2skaqXFMkkBSX69j7VXM3ru2ez fetchai/connections/gym,QmXpTer28dVvxeXqsXzaBqX551QToh9w5KJC2oXcStpKJG -fetchai/connections/http_client,QmcvCouzByryadF1H9YbgDotRmV26F9QhrxFSdGmRgcdNV +fetchai/connections/http_client,QmUjtATHombNqbwHRonc3pLUTfuvQJBxqGAj4K5zKT8beQ fetchai/connections/http_server,QmXuGssPAahvRXHNmYrvtqYokgeCqavoiK7x9zmjQT8w23 fetchai/connections/ledger,QmVXceMJCioA1Hro9aJgBwrF9yLgToaVXifDz6EVo6vTXn fetchai/connections/local,QmZKciQTgE8LLHsgQX4F5Ecc7rNPp9BBSWQHEEe7jEMEmJ