models: more logging
This commit is contained in:
parent
0d80c686c7
commit
814d5eade7
1 changed files with 7 additions and 2 deletions
|
|
@ -36,6 +36,7 @@ async def make_teilchen_input(text: str) -> TeilchenCreate | None:
|
|||
name = text[0:name_end]
|
||||
if not name:
|
||||
logger.error("Could not extract name.")
|
||||
logger.debug("Could not extract name from input: %s", text)
|
||||
return None
|
||||
|
||||
description_start = text.find('"', name_end + 1)
|
||||
|
|
@ -47,14 +48,18 @@ async def make_teilchen_input(text: str) -> TeilchenCreate | None:
|
|||
|
||||
tags = re.findall(r"#\w+", text.lower())
|
||||
if not tags:
|
||||
logger.info("No tags found in text.")
|
||||
logger.info("Could not extract tags.")
|
||||
logger.debug("Could not extract tags from input: %s", text)
|
||||
|
||||
return TeilchenCreate(
|
||||
teilchen = TeilchenCreate(
|
||||
name=name,
|
||||
description=description,
|
||||
tags=" ".join(natsorted(tags)),
|
||||
text=text,
|
||||
)
|
||||
logger.debug("Created new Teilchen: %r", teilchen)
|
||||
|
||||
return teilchen
|
||||
|
||||
|
||||
async def load_initial_data() -> Sequence[Teilchen]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue