From: Adam Dullage Date: Thu, 19 Dec 2024 21:00:26 +0000 (+0000) Subject: Remove logging in file_system.py X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=53cf3fdb39b5b44dcc89bfc73820f2de38876ccf;p=flatnotes.git Remove logging in file_system.py --- diff --git a/server/notes/file_system/file_system.py b/server/notes/file_system/file_system.py index f032638..656c207 100644 --- a/server/notes/file_system/file_system.py +++ b/server/notes/file_system/file_system.py @@ -43,7 +43,9 @@ class IndexSchema(SchemaClass): class FileSystemNotes(BaseNotes): TAGS_RE = re.compile(r"(?:(?<=^#)|(?<=\s#))[a-zA-Z0-9_-]+(?=\s|$)") CODEBLOCK_RE = re.compile(r"`{1,3}.*?`{1,3}", re.DOTALL) - TAGS_WITH_HASH_RE = re.compile(r"(?:(?<=^)|(?<=\s))#[a-zA-Z0-9_-]+(?=\s|$)") + TAGS_WITH_HASH_RE = re.compile( + r"(?:(?<=^)|(?<=\s))#[a-zA-Z0-9_-]+(?=\s|$)" + ) def __init__(self): self.storage_path = get_env("FLATNOTES_PATH", mandatory=True) @@ -196,11 +198,8 @@ class FileSystemNotes(BaseNotes): - The content without the tags. - A set of tags converted to lowercase.""" content_ex_codeblock = re.sub(cls.CODEBLOCK_RE, "", content) - logger.debug(f"Content without codeblocks: {content_ex_codeblock}") _, tags = cls._re_extract(cls.TAGS_RE, content_ex_codeblock) - logger.debug(f"Tags extracted: {tags}") content_ex_tags, _ = cls._re_extract(cls.TAGS_RE, content) - logger.debug(f"Content without tags: {content_ex_tags}") try: tags = [tag.lower() for tag in tags] return (content_ex_tags, set(tags)) @@ -238,7 +237,6 @@ class FileSystemNotes(BaseNotes): indexed = set() writer = self.index.writer() if clean: - logger.info(f"Cleaning index {clean}") writer.mergetype = writing.CLEAR # Clear the index with self.index.searcher() as searcher: for idx_note in searcher.all_stored_fields(): @@ -268,7 +266,6 @@ class FileSystemNotes(BaseNotes): writer, self._get_by_filename(filename) ) logger.info(f"'{filename}' added to index") - writer.commit(optimize=optimize) logger.info("Index synchronized")