Skip to content

Commit 1334292

Browse files
committed
Add a name argument to LoggingConfigUpdatingActor
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent c60aaa0 commit 1334292

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/frequenz/sdk/config/_logging_actor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,16 @@ async def run() -> None:
134134
def __init__(
135135
self,
136136
*,
137+
name: str | None = None,
137138
config_recv: Receiver[Mapping[str, Any]],
138139
log_format: str = "%(asctime)s %(levelname)-8s %(name)s:%(lineno)s: %(message)s",
139140
log_datefmt: str = "%Y-%m-%dT%H:%M:%S%z",
140141
):
141142
"""Initialize this instance.
142143
143144
Args:
145+
name: The name of this actor. If `None`, `str(id(self))` will be used. This
146+
is used mostly for debugging purposes.
144147
config_recv: The receiver to listen for configuration changes.
145148
log_format: Use the specified format string in logs.
146149
log_datefmt: Use the specified date/time format in logs.
@@ -151,7 +154,7 @@ def __init__(
151154
in the application (through a previous `basicConfig()` call), then the format
152155
settings specified here will be ignored.
153156
"""
154-
super().__init__()
157+
super().__init__(name=name)
155158
self._config_recv = config_recv
156159

157160
# Setup default configuration.

0 commit comments

Comments
 (0)