Skip to content

Commit

Permalink
Update logger for link parser
Browse files Browse the repository at this point in the history
  • Loading branch information
20001LastOrder committed Aug 24, 2023
1 parent fbf1eb3 commit da141f5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/slackbot/output_parsers/link_parse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import re

from loguru import logger

from output_parsers.base import BaseOutputParser


Expand All @@ -26,7 +28,7 @@ def replace_with_symbol(match: re.Match):
return "DocID:" + self.link_to_id[link] + "\n\n"

def replace_with_link(match: re.Match):
print(match)
logger.debug(match)
doc_id = int(match.group(1))
if doc_id < 0 or doc_id >= len(self.links):
return ""
Expand All @@ -36,7 +38,6 @@ def replace_with_link(match: re.Match):
modified_text = re.sub(self.url_pattern, replace_with_symbol, text)
else:
modified_text = re.sub(self.doc_id_pattern, replace_with_link, text)
print(modified_text)
# print(modified_text)
logger.debug(modified_text)

return modified_text

0 comments on commit da141f5

Please sign in to comment.