Skip to content
Open
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# OpenAI support (required)
OPENAI_API_KEY=sk-proj-qwertya

# Logging configuration (optional)
# LOG_LEVEL=INFO

# VCS connector setup (required to connect core pipeline with VCS)
#VCS_PROVIDER=github
#VCS_ACCESS_TOKEN=<your Github access token>
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ Running as a service to automatically process issues:

## Configuration

### Logging

DeepNext uses [Loguru](https://loguru.readthedocs.io/) for logging.
By default, the log level is set to `INFO` to reduce verbosity.
You can override the log level by setting the `LOG_LEVEL` environment variable in your `.env` file:

```env
# LOG_LEVEL=DEBUG
```

Supported values: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`.

### LLM Providers

DeepNext supports multiple LLM providers:
- OpenAI
- AWS Bedrock (Claude, Mistral, and others)
Expand Down
3 changes: 2 additions & 1 deletion apps/app/deep_next/app/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ def main() -> None:


if __name__ == "__main__":
from deep_next.common.common import load_monorepo_dotenv
from deep_next.common.common import load_monorepo_dotenv, setup_logging

load_monorepo_dotenv()
setup_logging()

main()
3 changes: 2 additions & 1 deletion apps/app/deep_next/app/entrypoint_scheduled.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ def cli(interval_s: int):


if __name__ == "__main__":
from deep_next.common.common import load_monorepo_dotenv
from deep_next.common.common import load_monorepo_dotenv, setup_logging

load_monorepo_dotenv()
setup_logging()

cli()
19 changes: 19 additions & 0 deletions libs/common/deep_next/common/common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os
import sys
import textwrap

from dotenv import load_dotenv
Expand Down Expand Up @@ -60,3 +62,20 @@ def prepare_issue_statement(
{issue_comments_str}
"""
)


def setup_logging() -> None:
"""
Configure Loguru logging for the application.

This function sets up Loguru to use the log level specified by the LOG_LEVEL
environment variable (default: INFO). It removes all existing Loguru handlers
to prevent duplicate or conflicting outputs, then adds a single handler that
outputs to stdout at the configured log level. This ensures consistent logging
behavior across the application and allows dynamic adjustment of verbosity
through the LOG_LEVEL environment variable.
"""
log_level = os.environ.get("LOG_LEVEL", "INFO").upper()
logger.remove()
logger.add(sys.stdout, level=log_level)
logger.debug(f"Loguru logging configured. LOG_LEVEL={log_level}")
3 changes: 2 additions & 1 deletion libs/core/deep_next/core/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ def cli(


if __name__ == "__main__":
from deep_next.common.common import load_monorepo_dotenv
from deep_next.common.common import load_monorepo_dotenv, setup_logging

load_monorepo_dotenv()
setup_logging()

cli()
Loading