Skip to content

Commit 7f2536c

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

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414
## New Features
1515

16-
<!-- Here goes the main new features and examples or instructions on how to use them -->
16+
- `LoggingConfigUpdatingActor`
17+
18+
* Added a new `name` argument to the constructor to be able to override the actor's name.
1719

1820
## Bug Fixes
1921

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)