mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Log processed entries by org_to_jsonl only if verbosity > 2
Output too verbose for even debug mode logging. So gated behind -vvv
This commit is contained in:
@@ -12,6 +12,7 @@ import logging
|
|||||||
from src.processor.org_mode import orgnode
|
from src.processor.org_mode import orgnode
|
||||||
from src.utils.helpers import get_absolute_path, is_none_or_empty
|
from src.utils.helpers import get_absolute_path, is_none_or_empty
|
||||||
from src.utils.jsonl import dump_jsonl, compress_jsonl_data
|
from src.utils.jsonl import dump_jsonl, compress_jsonl_data
|
||||||
|
from src.utils import state
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -86,23 +87,28 @@ def convert_org_entries_to_jsonl(entries, entry_to_file_map) -> str:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
entry_dict["compiled"] = f'{entry.Heading()}.'
|
entry_dict["compiled"] = f'{entry.Heading()}.'
|
||||||
|
if state.verbose > 2:
|
||||||
logger.debug(f"Title: {entry.Heading()}")
|
logger.debug(f"Title: {entry.Heading()}")
|
||||||
|
|
||||||
if entry.Tags():
|
if entry.Tags():
|
||||||
tags_str = " ".join(entry.Tags())
|
tags_str = " ".join(entry.Tags())
|
||||||
entry_dict["compiled"] += f'\t {tags_str}.'
|
entry_dict["compiled"] += f'\t {tags_str}.'
|
||||||
|
if state.verbose > 2:
|
||||||
logger.debug(f"Tags: {tags_str}")
|
logger.debug(f"Tags: {tags_str}")
|
||||||
|
|
||||||
if entry.Closed():
|
if entry.Closed():
|
||||||
entry_dict["compiled"] += f'\n Closed on {entry.Closed().strftime("%Y-%m-%d")}.'
|
entry_dict["compiled"] += f'\n Closed on {entry.Closed().strftime("%Y-%m-%d")}.'
|
||||||
|
if state.verbose > 2:
|
||||||
logger.debug(f'Closed: {entry.Closed().strftime("%Y-%m-%d")}')
|
logger.debug(f'Closed: {entry.Closed().strftime("%Y-%m-%d")}')
|
||||||
|
|
||||||
if entry.Scheduled():
|
if entry.Scheduled():
|
||||||
entry_dict["compiled"] += f'\n Scheduled for {entry.Scheduled().strftime("%Y-%m-%d")}.'
|
entry_dict["compiled"] += f'\n Scheduled for {entry.Scheduled().strftime("%Y-%m-%d")}.'
|
||||||
|
if state.verbose > 2:
|
||||||
logger.debug(f'Scheduled: {entry.Scheduled().strftime("%Y-%m-%d")}')
|
logger.debug(f'Scheduled: {entry.Scheduled().strftime("%Y-%m-%d")}')
|
||||||
|
|
||||||
if entry.Body():
|
if entry.Body():
|
||||||
entry_dict["compiled"] += f'\n {entry.Body()}'
|
entry_dict["compiled"] += f'\n {entry.Body()}'
|
||||||
|
if state.verbose > 2:
|
||||||
logger.debug(f"Body: {entry.Body()}")
|
logger.debug(f"Body: {entry.Body()}")
|
||||||
|
|
||||||
if entry_dict:
|
if entry_dict:
|
||||||
|
|||||||
Reference in New Issue
Block a user