Skip to content

[DeepNext] Resolve issue #165: Make logging by default on INFO level#172

Closed
pjedlikowskistx wants to merge 2 commits intodevelopfrom
deep_next/issue_165/2025_09_26_11_35_42
Closed

[DeepNext] Resolve issue #165: Make logging by default on INFO level#172
pjedlikowskistx wants to merge 2 commits intodevelopfrom
deep_next/issue_165/2025_09_26_11_35_42

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 to reduce verbosity, while allowing
the log level to be overridden via the LOG_LEVEL environment variable. The project uses
Loguru for logging, and logging is initialized in multiple entry points (e.g.,
apps/app/deep_next/app/entrypoint.py, libs/core/deep_next/core/entrypoint.py, and
entrypoint_scheduled.py). To ensure consistent behavior, logging configuration should be
centralized and initialized as early as possible in each entry point. The LOG_LEVEL env
variable should be documented in .env.example. This approach ensures that all logs
default to INFO unless overridden, and that configuration is clear and maintainable.

Action Plan

What do you think about the action plan below?

[
    {
        "title": "Add LOG_LEVEL to .env.example and document its usage",
        "description": "Update the .env.example file at the project root to include a commented LOG_LEVEL variable. Add a comment explaining that it controls the default log level (e.g., INFO, DEBUG, WARNING, ERROR) and defaults to INFO if not set.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/.env.example)"
    },
    {
        "title": "Centralize log level configuration in a utility function",
        "description": "Create or update a logging utility (e.g., libs/common/deep_next/common/common.py or a new log.py) to provide a function that reads LOG_LEVEL from the environment (defaulting to INFO), removes any existing Loguru handlers, and adds a new handler with the correct level. This function should be reusable across all entry points.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/libs/common/deep_next/common/common.py)"
    },
    {
        "title": "Initialize logging with the correct level in all entry points",
        "description": "At the very start of each main entry point (apps/app/deep_next/app/entrypoint.py, apps/app/deep_next/app/entrypoint_scheduled.py, libs/core/deep_next/core/entrypoint.py), call the centralized logging setup function before any logging occurs. This ensures the log level is set according to LOG_LEVEL or defaults to INFO.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/apps/app/deep_next/app/entrypoint.py)"
    },
    {
        "title": "Initialize logging in scheduled entrypoint",
        "description": "Repeat the logging initialization step in apps/app/deep_next/app/entrypoint_scheduled.py to ensure consistent log level handling for scheduled runs.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/apps/app/deep_next/app/entrypoint_scheduled.py)"
    },
    {
        "title": "Initialize logging in core pipeline entrypoint",
        "description": "Repeat the logging initialization step in libs/core/deep_next/core/entrypoint.py to ensure consistent log level handling for the core pipeline.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/libs/core/deep_next/core/entrypoint.py)"
    }
]

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

@pjedlikowskistx
Copy link
Contributor Author

@deepnext
Add some information to the README

@pjedlikowskistx
Copy link
Contributor Author

🚧 DeepNext status update

Reasoning (for context only)

The goal is to make INFO the default logging level to reduce verbosity, while allowing
the log level to be overridden via the LOG_LEVEL environment variable. The project uses
Loguru for logging, and logging is initialized in multiple entry points
(apps/app/deep_next/app/entrypoint.py, apps/app/deep_next/app/entrypoint_scheduled.py,
and libs/core/deep_next/core/entrypoint.py). To ensure consistent behavior, logging
configuration should be centralized and initialized as early as possible in each entry
point. The LOG_LEVEL env variable should be documented in .env.example. Additionally,
per the feedback, the LOG_LEVEL variable and its effect must be documented in the README
for user visibility. This approach ensures that all logs default to INFO unless
overridden, configuration is clear and maintainable, and users are aware of the new
environment variable.

Action Plan

What do you think about the action plan below?

[
    {
        "title": "Add LOG_LEVEL to .env.example and document its usage",
        "description": "Update the .env.example file at the project root to include a commented LOG_LEVEL variable. Add a comment explaining that it controls the default log level (e.g., INFO, DEBUG, WARNING, ERROR) and defaults to INFO if not set.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/.env.example)"
    },
    {
        "title": "Centralize log level configuration in a utility function",
        "description": "Create or update a logging utility (e.g., libs/common/deep_next/common/common.py or a new log.py) to provide a function that reads LOG_LEVEL from the environment (defaulting to INFO), removes any existing Loguru handlers, and adds a new handler with the correct level. This function should be reusable across all entry points.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/libs/common/deep_next/common/common.py)"
    },
    {
        "title": "Initialize logging with the correct level in all entry points",
        "description": "At the very start of each main entry point (apps/app/deep_next/app/entrypoint.py, apps/app/deep_next/app/entrypoint_scheduled.py, libs/core/deep_next/core/entrypoint.py), call the centralized logging setup function before any logging occurs. This ensures the log level is set according to LOG_LEVEL or defaults to INFO.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/apps/app/deep_next/app/entrypoint.py)"
    },
    {
        "title": "Initialize logging in scheduled entrypoint",
        "description": "Repeat the logging initialization step in apps/app/deep_next/app/entrypoint_scheduled.py to ensure consistent log level handling for scheduled runs.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/apps/app/deep_next/app/entrypoint_scheduled.py)"
    },
    {
        "title": "Initialize logging in core pipeline entrypoint",
        "description": "Repeat the logging initialization step in libs/core/deep_next/core/entrypoint.py to ensure consistent log level handling for the core pipeline.",
        "target_file": "Path(/deep-next/___data/app/repositories/stxnext_deep-next/libs/core/deep_next/core/entrypoint.py)"
    },
    {
        "title": "Document LOG_LEVEL usage in the README",
        "description": "Update the README to document the LOG_LEVEL environment variable, explaining its purpose, possible values (e.g., INFO, DEBUG, WARNING, ERROR), and that it defaults to INFO if not set. This ensures users are aware of how to control logging verbosity.",
        "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: 339 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: 43 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