Skip to content

Conversation

@pjedlikowskistx
Copy link
Contributor

This is description for the MR created by DeepNext.

@pjedlikowskistx
Copy link
Contributor Author

🚧 DeepNext status update

🚀 DeepNext is onto it! Hold on...

@pjedlikowskistx
Copy link
Contributor Author

🚧 DeepNext status update

Reasoning (for context only)

The goal is to make INFO the default logging level and allow overriding it via the
LOG_LEVEL environment variable. The project uses Loguru for logging, and logging is
initialized in multiple entrypoints (apps/app/deep_next/app/entrypoint.py,
apps/app/deep_next/app/entrypoint_scheduled.py, libs/core/deep_next/core/entrypoint.py).
To ensure consistent behavior and avoid code duplication, a centralized logging setup
function should be implemented in a shared utility module
(libs/common/deep_next/common/common.py). This function will read the LOG_LEVEL
environment variable (defaulting to INFO), remove existing Loguru handlers, and add a
new handler with the correct level. All entrypoints should call this setup function
immediately after loading environment variables and before any logger usage. Adding a
LOG_LEVEL example to .env.example will help users discover and configure this option.
This approach is simple, maintainable, and aligns with project conventions.

Action Plan

What do you think about the action plan below?

[
    {
        "title": "Implement setup_logging() in common.py",
        "description": "Add a `setup_logging()` function to `libs/common/deep_next/common/common.py`. This function should:\n- Read the `LOG_LEVEL` environment variable (default to 'INFO' if not set).\n- Remove all existing Loguru handlers.\n- Add a new Loguru handler for stdout with the specified log level.\n- Optionally, print a debug message indicating the active log level.\n",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/libs/common/deep_next/common/common.py)"
    },
    {
        "title": "Call setup_logging() in main entrypoint",
        "description": "In `apps/app/deep_next/app/entrypoint.py`:\n- After loading environment variables (`load_monorepo_dotenv`), call `setup_logging()` before any logger usage.\n- This ensures the log level is set before any log messages are emitted.\n",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/apps/app/deep_next/app/entrypoint.py)"
    },
    {
        "title": "Call setup_logging() in scheduled entrypoint",
        "description": "In `apps/app/deep_next/app/entrypoint_scheduled.py`:\n- After loading environment variables, call `setup_logging()` before any logger usage.\n- This ensures consistent logging configuration in the scheduled tasks.\n",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/apps/app/deep_next/app/entrypoint_scheduled.py)"
    },
    {
        "title": "Call setup_logging() in core entrypoint",
        "description": "In `libs/core/deep_next/core/entrypoint.py`:\n- After loading environment variables, call `setup_logging()` before any logger usage.\n- This ensures consistent logging in the core CLI functionality.\n",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/libs/core/deep_next/core/entrypoint.py)"
    },
    {
        "title": "Add LOG_LEVEL example to .env.example",
        "description": "Add a commented example of the `LOG_LEVEL` variable to `.env.example`, e.g.:\n# LOG_LEVEL=INFO\nThis helps users discover and configure the log level as needed.\n",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/.env.example)"
    }
]

How to respond?

👌 To ACCEPT the action plan, respond with:

@deepnext
OK

✏️ To REQUEST CHANGES to the action plan, talk to DeepNext following the message format:

@deepnext
<message to DeepNext>

🟢 Step finished. Waiting for your response...

⏱️ DeepNext core execution time: 339 seconds.

@pjedlikowskistx
Copy link
Contributor Author

@deepnext
Add some documentation to the README

@pjedlikowskistx
Copy link
Contributor Author

🚧 DeepNext status update

Reasoning (for context only)

The task is to make INFO the default logging level, allow overriding it via the
LOG_LEVEL environment variable, and—per new feedback—add documentation to the README.
The project uses Loguru for logging, and logging is initialized in multiple entrypoints.
To ensure consistent behavior and avoid code duplication, a centralized setup_logging()
function should be implemented in a shared utility module
(libs/common/deep_next/common/common.py). All entrypoints should call this setup
function after loading environment variables and before any logger usage. A commented
LOG_LEVEL example should be added to .env.example to help users discover and configure
this option. Finally, per the latest feedback, documentation about LOG_LEVEL and its
effect should be added to the README. This approach is simple, maintainable, and aligns
with project conventions.

Action Plan

What do you think about the action plan below?

[
    {
        "title": "Implement setup_logging() in common.py",
        "description": "Add a `setup_logging()` function to `libs/common/deep_next/common/common.py`. This function should:\n- Read the `LOG_LEVEL` environment variable (default to 'INFO' if not set).\n- Remove all existing Loguru handlers.\n- Add a new Loguru handler for stdout with the specified log level.\n- Optionally, print a debug message indicating the active log level.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/libs/common/deep_next/common/common.py)"
    },
    {
        "title": "Call setup_logging() in main entrypoint",
        "description": "In `apps/app/deep_next/app/entrypoint.py`:\n- After loading environment variables (`load_monorepo_dotenv`), call `setup_logging()` before any logger usage.\n- This ensures the log level is set before any log messages are emitted.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/apps/app/deep_next/app/entrypoint.py)"
    },
    {
        "title": "Call setup_logging() in scheduled entrypoint",
        "description": "In `apps/app/deep_next/app/entrypoint_scheduled.py`:\n- After loading environment variables, call `setup_logging()` before any logger usage.\n- This ensures consistent logging configuration in the scheduled tasks.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/apps/app/deep_next/app/entrypoint_scheduled.py)"
    },
    {
        "title": "Call setup_logging() in core entrypoint",
        "description": "In `libs/core/deep_next/core/entrypoint.py`:\n- After loading environment variables, call `setup_logging()` before any logger usage.\n- This ensures consistent logging in the core CLI functionality.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/libs/core/deep_next/core/entrypoint.py)"
    },
    {
        "title": "Add LOG_LEVEL example to .env.example",
        "description": "Add a commented example of the `LOG_LEVEL` variable to `.env.example`, e.g.:\n# LOG_LEVEL=INFO\nThis helps users discover and configure the log level as needed.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/.env.example)"
    },
    {
        "title": "Document LOG_LEVEL in README",
        "description": "Update the `README.md` to document the `LOG_LEVEL` environment variable. Explain that it controls the default logging verbosity (default: INFO), and can be set to DEBUG, WARNING, ERROR, etc. Mention where to set it and how it affects log output.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/README.md)"
    }
]

How to respond?

👌 To ACCEPT the action plan, respond with:

@deepnext
OK

✏️ To REQUEST CHANGES to the action plan, talk to DeepNext following the message format:

@deepnext
<message to DeepNext>

🟢 Step finished. Waiting for your response...

⏱️ DeepNext core execution time: 38 seconds.

@pjedlikowskistx
Copy link
Contributor Author

@deepnext
OK

@pjedlikowskistx
Copy link
Contributor Author

🚧 DeepNext status update

💾 Action plan successfully implemented.


🟢 Step finished.

⏱️ DeepNext core execution time: 41 seconds.


🎉 Issue solved! See you next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant