Skip to content

Commit 77d5675

Browse files
authored
Log host:port when connecting to a microgrid (#400)
2 parents 0408bd8 + 4c67d23 commit 77d5675

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/frequenz/sdk/microgrid/connection_manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
component graph.
99
"""
1010

11+
import logging
1112
from abc import ABC, abstractmethod
1213
from typing import Optional
1314

@@ -21,6 +22,8 @@
2122
_DEFAULT_MICROGRID_HOST = "[::1]"
2223
_DEFAULT_MICROGRID_PORT = 443
2324

25+
_logger = logging.getLogger(__name__)
26+
2427

2528
class ConnectionManager(ABC):
2629
"""Creates and stores core features."""
@@ -157,6 +160,8 @@ async def initialize(host: str, port: int) -> None:
157160
if _CONNECTION_MANAGER is not None:
158161
raise AssertionError("MicrogridApi was already initialized.")
159162

163+
_logger.info("Connecting to microgrid at %s:%s", host, port)
164+
160165
microgrid_api = _InsecureConnectionManager(host, port)
161166
await microgrid_api._initialize() # pylint: disable=protected-access
162167

0 commit comments

Comments
 (0)