Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show invalid parser as error in the logger #495

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/invoice2data/extract/invoice_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ def extract(self, optimized_str: str, invoice_file: str, input_module: str) -> O
if value:
output[k] = value
else:
logger.error("Failed to parse field %s with parser %s", k, v["parser"])
logger.warning("Failed to parse field %s with parser %s", k, v["parser"])
else:
logger.warning("Field %s has unknown parser %s set", k, v["parser"])
logger.error("Field %s has unknown parser %s set", k, v["parser"])
else:
logger.warning("Field %s doesn't have parser specified", k)
logger.error("Field %s doesn't have parser specified", k)
elif k.startswith("static_"):
logger.debug("field=%s | static value=%s", k, v)
output[k.replace("static_", "")] = v
Expand Down