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

add enable_logging flag #25

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions python/graphrag/graphrag/index/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ async def execute():
memory_profile=memprofile,
cache=cache,
progress_reporter=progress_reporter,
enable_logging=True,
AlonsoGuevara marked this conversation as resolved.
Show resolved Hide resolved
emit=[TableEmitterType(e) for e in pipeline_emit]
if pipeline_emit
else None,
Expand Down
5 changes: 4 additions & 1 deletion python/graphrag/graphrag/index/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ async def run_pipeline_with_config(
memory_profile: bool = False,
debug: bool = False,
resume: str | None = None,
enable_logging: bool | None = None,
**_kwargs: dict,
) -> AsyncIterable[PipelineRunResult]:
"""Run a pipeline with the given config.
Expand All @@ -93,6 +94,7 @@ async def run_pipeline_with_config(
- cache - The cache to use for the pipeline (this overrides the config)
- reporter - The reporter to use for the pipeline (this overrides the config)
- input_post_process_steps - The post process steps to run on the input data (this overrides the config)
- enable_logging - Whether to configure logging for the pipeline. If false, you should configure the standard Python logging yourself.
- debug - Whether or not to run in debug mode
"""
if isinstance(config_or_path, str):
Expand Down Expand Up @@ -131,7 +133,8 @@ def _create_postprocess_steps(
) -> list[PipelineWorkflowStep] | None:
return config.post_process if config is not None else None

_enable_logging(root_dir or "", reporting_dir, debug)
if enable_logging:
_enable_logging(root_dir or "", reporting_dir, debug)

progress_reporter = progress_reporter or NullProgressReporter()
storage = storage or _create_storage(config.storage)
Expand Down
Loading