From c6d52b3b61b266a2cfc2e94bbe12c3ca52ecc403 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 29 Oct 2022 15:52:16 -0700 Subject: [PATCH] update logging statements --- jrnl/encryption/BaseEncryption.py | 4 +++- jrnl/encryption/BasePasswordEncryption.py | 2 +- jrnl/encryption/Jrnlv1Encryption.py | 2 +- jrnl/encryption/Jrnlv2Encryption.py | 2 +- jrnl/encryption/NoEncryption.py | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jrnl/encryption/BaseEncryption.py b/jrnl/encryption/BaseEncryption.py index af0b8621..538bee74 100644 --- a/jrnl/encryption/BaseEncryption.py +++ b/jrnl/encryption/BaseEncryption.py @@ -12,15 +12,17 @@ from jrnl.messages import MsgText class BaseEncryption(ABC): def __init__(self, journal_name: str, config: dict): - logging.debug("BaseEncryption init") + logging.debug("BaseEncryption.__init__ start") self._encoding: str = "utf-8" self._journal_name: str = journal_name self._config: dict = config def encrypt(self, text: str) -> bytes: + logging.debug("BaseEncryption.encrypt start") return self._encrypt(text) def decrypt(self, text: bytes) -> str: + logging.debug("BaseEncryption.decrypt start") if (result := self._decrypt(text)) is None: raise JrnlException( Message(MsgText.DecryptionFailedGeneric, MsgStyle.ERROR) diff --git a/jrnl/encryption/BasePasswordEncryption.py b/jrnl/encryption/BasePasswordEncryption.py index 1315cf88..392c0575 100644 --- a/jrnl/encryption/BasePasswordEncryption.py +++ b/jrnl/encryption/BasePasswordEncryption.py @@ -14,8 +14,8 @@ from jrnl.prompt import prompt_password class BasePasswordEncryption(BaseEncryption): def __init__(self, *args, **kwargs) -> None: - logging.debug("BasePasswordEncryption init") super().__init__(*args, **kwargs) + logging.debug("BasePasswordEncryption.__init__ start") self._attempts: int = 0 self._max_attempts: int = 3 self._password: str = "" diff --git a/jrnl/encryption/Jrnlv1Encryption.py b/jrnl/encryption/Jrnlv1Encryption.py index bedb4106..faeeda45 100644 --- a/jrnl/encryption/Jrnlv1Encryption.py +++ b/jrnl/encryption/Jrnlv1Encryption.py @@ -14,8 +14,8 @@ from jrnl.encryption.BasePasswordEncryption import BasePasswordEncryption class Jrnlv1Encryption(BasePasswordEncryption): def __init__(self, *args, **kwargs) -> None: - logging.debug("Jrnlv1Encryption init") super().__init__(*args, **kwargs) + logging.debug("Jrnlv1Encryption.__init__ start") def _encrypt(self, _: str) -> bytes: raise NotImplementedError diff --git a/jrnl/encryption/Jrnlv2Encryption.py b/jrnl/encryption/Jrnlv2Encryption.py index 47b3c0bc..6d9333df 100644 --- a/jrnl/encryption/Jrnlv2Encryption.py +++ b/jrnl/encryption/Jrnlv2Encryption.py @@ -14,12 +14,12 @@ from .BasePasswordEncryption import BasePasswordEncryption class Jrnlv2Encryption(BasePasswordEncryption): def __init__(self, *args, **kwargs) -> None: - logging.debug("Jrnlv2Encryption init") # Salt is hard-coded self._salt: bytes = b"\xf2\xd5q\x0e\xc1\x8d.\xde\xdc\x8e6t\x89\x04\xce\xf8" self._key: bytes = b"" super().__init__(*args, **kwargs) + logging.debug("Jrnlv2Encryption.__init__ start") @property def password(self): diff --git a/jrnl/encryption/NoEncryption.py b/jrnl/encryption/NoEncryption.py index 9c4dbf92..5c0f4961 100644 --- a/jrnl/encryption/NoEncryption.py +++ b/jrnl/encryption/NoEncryption.py @@ -7,7 +7,7 @@ from jrnl.encryption.BaseEncryption import BaseEncryption class NoEncryption(BaseEncryption): def __init__(self, *args, **kwargs): - logging.debug("NoEncryption init") + logging.debug("NoEncryption.__init__ start") super().__init__(*args, **kwargs) def _encrypt(self, text: str) -> bytes: