From 0100d6258e235c6a35705f514d83ddf99be19e62 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 9 Dec 2024 11:47:53 +0100 Subject: [PATCH 1/2] Fix typo in release notes Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 5aeb9e0ba..c9ffa190b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -18,7 +18,7 @@ + The `load()` method was removed. Please use `frequenz.sdk.config.load_config()` instead. + The class is now a standard `dataclass` instead of a `marshmallow_dataclass`. - * `LoggerConfig` is not a standard `dataclass` instead of a `marshmallow_dataclass`. + * `LoggerConfig` is now a standard `dataclass` instead of a `marshmallow_dataclass`. ## New Features From 6ad4463aa331a28229ac0f4e4a282ae2fa0e62b5 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 9 Dec 2024 11:47:20 +0100 Subject: [PATCH 2/2] Make `LoggerConfig` and `LoggingConfig` frozen and keyword-only Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 8 +++++++- src/frequenz/sdk/config/_logging_actor.py | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c9ffa190b..1bbbd075f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -17,8 +17,14 @@ + The `load()` method was removed. Please use `frequenz.sdk.config.load_config()` instead. + The class is now a standard `dataclass` instead of a `marshmallow_dataclass`. + + The class is now immutable. + + The constructor now accepts only keyword arguments. - * `LoggerConfig` is now a standard `dataclass` instead of a `marshmallow_dataclass`. + * `LoggerConfig` + + + The class is now a standard `dataclass` instead of a `marshmallow_dataclass`. + + The class is now immutable. + + The constructor now accepts only keyword arguments. ## New Features diff --git a/src/frequenz/sdk/config/_logging_actor.py b/src/frequenz/sdk/config/_logging_actor.py index 3941ad3bf..7ba2f6b21 100644 --- a/src/frequenz/sdk/config/_logging_actor.py +++ b/src/frequenz/sdk/config/_logging_actor.py @@ -26,7 +26,7 @@ """A marshmallow field for validating log levels.""" -@dataclass +@dataclass(frozen=True, kw_only=True) class LoggerConfig: """A configuration for a logger.""" @@ -41,7 +41,7 @@ class LoggerConfig: """The log level for the logger.""" -@dataclass +@dataclass(frozen=True, kw_only=True) class LoggingConfig: """A configuration for the logging system."""