Remove logging in file_system.py
authorAdam Dullage <redacted>
Thu, 19 Dec 2024 21:00:26 +0000 (21:00 +0000)
committerAdam Dullage <redacted>
Thu, 19 Dec 2024 21:00:26 +0000 (21:00 +0000)
server/notes/file_system/file_system.py

index f03263856d12bb6fa7ed9168db40982511f15ac8..656c20797cf31a5ab6f522bd63891356f5fbf1f7 100644 (file)
@@ -43,7 +43,9 @@ class IndexSchema(SchemaClass):
 class FileSystemNotes(BaseNotes):\r
     TAGS_RE = re.compile(r"(?:(?<=^#)|(?<=\s#))[a-zA-Z0-9_-]+(?=\s|$)")\r
     CODEBLOCK_RE = re.compile(r"`{1,3}.*?`{1,3}", re.DOTALL)\r
-    TAGS_WITH_HASH_RE = re.compile(r"(?:(?<=^)|(?<=\s))#[a-zA-Z0-9_-]+(?=\s|$)")\r
+    TAGS_WITH_HASH_RE = re.compile(\r
+        r"(?:(?<=^)|(?<=\s))#[a-zA-Z0-9_-]+(?=\s|$)"\r
+    )\r
 \r
     def __init__(self):\r
         self.storage_path = get_env("FLATNOTES_PATH", mandatory=True)\r
@@ -196,11 +198,8 @@ class FileSystemNotes(BaseNotes):
         - The content without the tags.\r
         - A set of tags converted to lowercase."""\r
         content_ex_codeblock = re.sub(cls.CODEBLOCK_RE, "", content)\r
-        logger.debug(f"Content without codeblocks: {content_ex_codeblock}")\r
         _, tags = cls._re_extract(cls.TAGS_RE, content_ex_codeblock)\r
-        logger.debug(f"Tags extracted: {tags}")\r
         content_ex_tags, _ = cls._re_extract(cls.TAGS_RE, content)\r
-        logger.debug(f"Content without tags: {content_ex_tags}")\r
         try:\r
             tags = [tag.lower() for tag in tags]\r
             return (content_ex_tags, set(tags))\r
@@ -238,7 +237,6 @@ class FileSystemNotes(BaseNotes):
         indexed = set()\r
         writer = self.index.writer()\r
         if clean:\r
-            logger.info(f"Cleaning index {clean}")\r
             writer.mergetype = writing.CLEAR  # Clear the index\r
         with self.index.searcher() as searcher:\r
             for idx_note in searcher.all_stored_fields():\r
@@ -268,7 +266,6 @@ class FileSystemNotes(BaseNotes):
                     writer, self._get_by_filename(filename)\r
                 )\r
                 logger.info(f"'{filename}' added to index")\r
-\r
         writer.commit(optimize=optimize)\r
         logger.info("Index synchronized")\r
 \r
git clone https://git.99rst.org/PROJECT