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

Refactor the logging setup loggic #3896

Merged
merged 12 commits into from
Jun 25, 2024
Merged

Refactor the logging setup loggic #3896

merged 12 commits into from
Jun 25, 2024

Conversation

noklam
Copy link
Contributor

@noklam noklam commented May 28, 2024

Description

I was pairing with @jitu5 and found that the logic of logging become quite complicated. @lrcouto @SajidAlamQB because you have made changes to this file recently. There is an opportunity to remove duplicate checking and overload variable default_logging_config.

Development notes

  • logger.info will always emit logs for which logging file is read
  • simplify the logic

Developer Certificate of Origin

We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a Signed-off-by line in the commit message. See our wiki for guidance.

If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.

Checklist

  • Read the contributing guidelines
  • Signed off each commit with a Developer Certificate of Origin (DCO)
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes
  • Checked if this change will affect Kedro-Viz, and if so, communicated that with the Viz team

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
@noklam noklam requested a review from merelcht as a code owner May 28, 2024 13:31
@noklam noklam requested review from lrcouto, SajidAlamQB, astrojuanlu and jitu5 and removed request for merelcht May 28, 2024 13:31
@noklam noklam self-assigned this May 28, 2024
@lrcouto
Copy link
Contributor

lrcouto commented May 28, 2024

I like the changes. The messages about the logging itself are rightly informative.

@astrojuanlu
Copy link
Member

logger.info will always emit logs for which logging file is read

👍🏼

Copy link
Contributor

@SajidAlamQB SajidAlamQB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, thank you @noklam!

@noklam
Copy link
Contributor Author

noklam commented May 29, 2024

Need a bit more thinking here:
image

It's a nice idea but this is a chicken and egg problem. The log would not show up until we set the logging level. By default python show WARNINGs only so logger.info did log something but there is no easy way to actually see the log.

@noklam
Copy link
Contributor Author

noklam commented May 29, 2024

image
Fix the annotation from ``` to ' (for rich), delay the log after self.configure is run.

@noklam noklam requested a review from merelcht June 7, 2024 14:10
@merelcht merelcht self-assigned this Jun 10, 2024
Copy link
Member

@merelcht merelcht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @noklam

kedro/framework/project/__init__.py Show resolved Hide resolved
@noklam noklam enabled auto-merge (squash) June 12, 2024 14:25
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
…g/kedro into noklam/logging-refactor

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
@noklam noklam merged commit 413dbca into main Jun 25, 2024
34 checks passed
@noklam noklam deleted the noklam/logging-refactor branch June 25, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants