Add debug logging for extractor
This commit is contained in:
parent
df235caf8f
commit
1bb1b80620
2 changed files with 9 additions and 2 deletions
|
@ -88,11 +88,11 @@ def _add_annots_to_note(
|
|||
f.write("\n".join(new_annotations))
|
||||
f.write("\n")
|
||||
logger.info(
|
||||
f"Wrote {len(new_annotations)} annotations "\
|
||||
f"Wrote {len(new_annotations)} "
|
||||
f"{'annotation' if len(new_annotations) == 1 else 'annotations'}"
|
||||
f"to {papis.document.describe(document)}"
|
||||
)
|
||||
|
||||
|
||||
if git:
|
||||
msg = "Update notes for '{0}'".format(papis.document.describe(document))
|
||||
folder = document.get_main_folder()
|
||||
|
|
|
@ -2,12 +2,15 @@ from pathlib import Path
|
|||
|
||||
import Levenshtein
|
||||
import fitz_new as fitz
|
||||
import papis.logging
|
||||
import papis.config
|
||||
|
||||
from papis_extract.annotation_data import Annotation
|
||||
|
||||
COLOR_MAPPING = {}
|
||||
|
||||
logger = papis.logging.get_logger(__name__)
|
||||
|
||||
|
||||
def start(filename: Path) -> list[Annotation]:
|
||||
"""Extract annotations from a file.
|
||||
|
@ -30,6 +33,10 @@ def start(filename: Path) -> list[Annotation]:
|
|||
)
|
||||
a.tag = _tag_from_colorname(a.colorname)
|
||||
annotations.append(a)
|
||||
logger.debug(
|
||||
f"Found {len(annotations)} "
|
||||
f"{'annotation' if len(annotations) == 1 else 'annotations'} for {filename}."
|
||||
)
|
||||
return annotations
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue