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 set the default logging level to INFO and allow users to override it via
the LOG_LEVEL environment variable. The project uses Loguru for logging, but currently
does not configure the log level globally—Loguru is imported and used directly in
various modules. To ensure consistent logging behavior and avoid code duplication, the
best approach is to implement a setup_logging() function 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 main entrypoints
(apps/app/deep_next/app/entrypoint.py, apps/app/deep_next/app/entrypoint_scheduled.py,
and libs/core/deep_next/core/entrypoint.py) should call this setup function immediately
after loading environment variables and before any logger usage. Finally, .env.example
should be updated to document the LOG_LEVEL variable for user discoverability. 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, log 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)"
    }
]

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: 158 seconds.

@pjedlikowskistx
Copy link
Contributor Author

@deepnext
Add some documentation to README

@pjedlikowskistx
Copy link
Contributor Author

🚧 DeepNext status update

Reasoning (for context only)

The goal is to set INFO as the default logging level and allow users to override 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.
Additionally, per feedback, the README should be updated to document the LOG_LEVEL
environment variable and how to configure logging. 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, log 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 and logging configuration in README.md",
        "description": "Update README.md to document the LOG_LEVEL environment variable and explain how to configure the logging level for DeepNext. Include a short section under Configuration or a dedicated Logging section, describing the default INFO level and how to override it using LOG_LEVEL.",
        "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: 45 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: 75 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