mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
better logging for the retagger
This commit is contained in:
parent
4db75537cb
commit
1091387f48
@ -1,5 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import tqdm
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
|
||||||
from documents.classifier import load_classifier
|
from documents.classifier import load_classifier
|
||||||
@ -67,9 +68,7 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
classifier = load_classifier()
|
classifier = load_classifier()
|
||||||
|
|
||||||
for document in documents:
|
for document in tqdm.tqdm(documents):
|
||||||
logger.info(
|
|
||||||
f"Processing document {document.title}")
|
|
||||||
|
|
||||||
if options['correspondent']:
|
if options['correspondent']:
|
||||||
set_correspondent(
|
set_correspondent(
|
||||||
|
@ -46,13 +46,13 @@ def set_correspondent(sender,
|
|||||||
selected = None
|
selected = None
|
||||||
if potential_count > 1:
|
if potential_count > 1:
|
||||||
if use_first:
|
if use_first:
|
||||||
logger.info(
|
logger.debug(
|
||||||
f"Detected {potential_count} potential correspondents, "
|
f"Detected {potential_count} potential correspondents, "
|
||||||
f"so we've opted for {selected}",
|
f"so we've opted for {selected}",
|
||||||
extra={'group': logging_group}
|
extra={'group': logging_group}
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logger.info(
|
logger.debug(
|
||||||
f"Detected {potential_count} potential correspondents, "
|
f"Detected {potential_count} potential correspondents, "
|
||||||
f"not assigning any correspondent",
|
f"not assigning any correspondent",
|
||||||
extra={'group': logging_group}
|
extra={'group': logging_group}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user