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]
|
name = text[0:name_end]
|
||||||
if not name:
|
if not name:
|
||||||
logger.error("Could not extract name.")
|
logger.error("Could not extract name.")
|
||||||
|
logger.debug("Could not extract name from input: %s", text)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
description_start = text.find('"', name_end + 1)
|
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())
|
tags = re.findall(r"#\w+", text.lower())
|
||||||
if not tags:
|
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,
|
name=name,
|
||||||
description=description,
|
description=description,
|
||||||
tags=" ".join(natsorted(tags)),
|
tags=" ".join(natsorted(tags)),
|
||||||
text=text,
|
text=text,
|
||||||
)
|
)
|
||||||
|
logger.debug("Created new Teilchen: %r", teilchen)
|
||||||
|
|
||||||
|
return teilchen
|
||||||
|
|
||||||
|
|
||||||
async def load_initial_data() -> Sequence[Teilchen]:
|
async def load_initial_data() -> Sequence[Teilchen]:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue