From e98f1ad80dad03f391724f8cf3453534b7eb920a Mon Sep 17 00:00:00 2001 From: Daniel Tomlinson Date: Sat, 20 Nov 2021 16:33:16 +0000 Subject: [PATCH] workaround #1 --- .vscode/settings.json | 17 +---------------- README.md | 9 +++++++-- panaetius/logging.py | 23 ++++++++++++++++++++--- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7c32b0d..9f07c66 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,20 +4,5 @@ "python.linting.enabled": true, "python.pythonPath": ".venv/bin/python", "restructuredtext.confPath": "${workspaceFolder}/docs/source", - "peacock.color": "#307E6A", - "workbench.colorCustomizations": { - "editorGroup.border": "#3ea389", - "panel.border": "#3ea389", - "sash.hoverBorder": "#3ea389", - "sideBar.border": "#3ea389", - "statusBar.background": "#307e6a", - "statusBar.foreground": "#e7e7e7", - "statusBarItem.hoverBackground": "#3ea389", - "statusBarItem.remoteBackground": "#307e6a", - "statusBarItem.remoteForeground": "#e7e7e7", - "titleBar.activeBackground": "#307e6a", - "titleBar.activeForeground": "#e7e7e7", - "titleBar.inactiveBackground": "#307e6a99", - "titleBar.inactiveForeground": "#e7e7e799" - } + "peacock.color": "#307E6A" } diff --git a/README.md b/README.md index f933352..76339ec 100644 --- a/README.md +++ b/README.md @@ -32,16 +32,21 @@ See Tembo for an example: str: raise NotImplementedError + @property + @abstractmethod + def logging_level(self) -> str: + raise NotImplementedError + @abstractmethod def __init__(self, logging_level: str): raise NotImplementedError @@ -119,8 +124,12 @@ class SimpleLogger(LoggingData): '"%(levelname)s",\n\t"message": "%(message)s"\n}', ) + @property + def logging_level(self) -> str: + return self._logging_level + def __init__(self, logging_level: str = "INFO"): - self.logging_level = logging_level + self._logging_level = logging_level class AdvancedLogger(LoggingData): @@ -133,8 +142,12 @@ class AdvancedLogger(LoggingData): '"%(levelname)s",\n\t"message": "%(message)s"\n}', ) + @property + def logging_level(self) -> str: + return self._logging_level + def __init__(self, logging_level: str = "INFO"): - self.logging_level = logging_level + self._logging_level = logging_level class CustomLogger(LoggingData): @@ -142,6 +155,10 @@ class CustomLogger(LoggingData): def format(self) -> str: return str(self._format) + @property + def logging_level(self) -> str: + return self._logging_level + def __init__(self, logging_format: str, logging_level: str = "INFO"): - self.logging_level = logging_level + self._logging_level = logging_level self._format = logging_format