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

fix: prevent logging config clobbering #10133

Merged
merged 5 commits into from
Nov 16, 2022
Merged

fix: prevent logging config clobbering #10133

merged 5 commits into from
Nov 16, 2022

Conversation

rkechols
Copy link
Contributor

@rkechols rkechols commented Nov 11, 2022

Fix for issue: #10132

  • Previous behavior: loading this repository with torch.hub.load clobbers the existing logging configuration by modifying the root logger's configuration.
  • New behavior: loading this repository with torch.hub.load only clobbers the logging configuration for logger yolov5 and its descendants.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced logging initiation process with dynamic logger name setup in the YOLOv5 code.

📊 Key Changes

  • Moved the "yolov5" logger name into a variable before initializing the logging.
  • Called set_logging() with the new logger_name variable.

🎯 Purpose & Impact

  • 🛠️ Maintainability: Defining the logger name as a variable makes the code more maintainable and clear.
  • 🔍 Clarity: It's now easier to change the logger name in one place if needed in the future.
  • 👥 User Experience: No direct impact on end users, but developers will appreciate the cleaner setup for logging.

Previous behavior: loading this repository with `torch.hub.load` clobbers the existing logging configuration by modifying the root logger's configuration.
New behavior: loading this repository with `torch.hub.load` only clobbers the logging configuration for logger `yolov5` and its descendants.

Signed-off-by: Ryan Echols <[email protected]>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

👋 Hello @rkechols, thank you for submitting a YOLOv5 🚀 PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • ✅ Verify your PR is up-to-date with ultralytics/yolov5 master branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running git pull and git merge master locally.
  • ✅ Verify all YOLOv5 Continuous Integration (CI) checks are passing.
  • ✅ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." — Bruce Lee

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Please what problem this line 129 and like 130 had??

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Oooh okay I get it now. You run before defining. Thank you. I was confused at first. 😂😂😂

@rkechols
Copy link
Contributor Author

@Christiansarpong , the linked issue, #10132, has more details if needed.

@glenn-jocher
Copy link
Member

@rkechols thanks for the PR! Can you please update your branch to master and then I'll merge?

@rkechols
Copy link
Contributor Author

@glenn-jocher it should be good now!
Thanks!

@glenn-jocher
Copy link
Member

glenn-jocher commented Nov 15, 2022

@rkechols thanks, but for some reason GitHub is showing me an out of date message here. It's strange because usually there's a button to update. I think there may be something wrong with the PR. Can you please close this one and open a new one with your updates? I'll prioritize that and should be able to merge immediately. Thanks!

Screenshot 2022-11-15 at 19 07 48

EDIT: maybe it's because I just merged another PR. Can you merge again? Apologies, just want to be on the safe side.

@rkechols
Copy link
Contributor Author

Yes, there was another button to update from main. It's running now.

@rkechols
Copy link
Contributor Author

@glenn-jocher , ready for you

@glenn-jocher glenn-jocher merged commit 166b9f2 into ultralytics:master Nov 16, 2022
@glenn-jocher
Copy link
Member

@rkechols PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐

@rkechols rkechols deleted the patch-1 branch November 16, 2022 15:21
glenn-jocher added a commit that referenced this pull request Nov 16, 2022
glenn-jocher added a commit that referenced this pull request Nov 16, 2022
Revert "fix: prevent logging config clobbering (#10133)"

This reverts commit 166b9f2.
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.

2 participants