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

Code Maintenance: Logging Updates #95

Merged
merged 4 commits into from Jan 12, 2020
Merged

Code Maintenance: Logging Updates #95

merged 4 commits into from Jan 12, 2020

Conversation

abhiTronix
Copy link
Owner

@abhiTronix abhiTronix commented Jan 12, 2020

Description

This PR brings various logging updates to fix faulty behavior that can conflict with other python libraries.

Keypoints

  • Added new logging handler helper function.
  • Removed conflicting system-wide dictionary logging formatter.
  • Isolated each API & test loggers and defined them globally to avoid redundant clones.
  • Removed PiGear from CLI completely due to camera hardware emulation limitation.
  • Fixed incorrect logic for pulling frames in ScreenGear CLI test
  • Limited imported OpenCV API version check scope to helper.py only.
  • Other Minor fixes.

Requirements / Checklist

Related Issue

None(direct fix)

Context

The vidgear's custom color-logger can conflict with other libraries that breaks functionality. Similar behavior was encounter when vidgear is used with uvicorn python library(More info: encode/uvicorn#410 (comment)), hence this PR aims at implementing separate isolated logger handler for vidgear and fixing other minor bugs.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Screenshots (if available):

None

- Added new `logging handler` helper function.
- Removed conflicting system-wide dictionary logging formatter.
- Isolated each API & test loggers.
- Removed PiGear from CLI completely  due to hardware emulation limitation.
- Other Minor fixes.
@abhiTronix abhiTronix added ENHANCEMENT ⚡ New Feature/Addition/Improvement MAINTENANCE 🏗️ Just sorting things out! WORK IN PROGRESS 🚧 currently been worked on. labels Jan 12, 2020
@abhiTronix abhiTronix added this to the 0.1.7 milestone Jan 12, 2020
@abhiTronix abhiTronix self-assigned this Jan 12, 2020
@codecov-io
Copy link

codecov-io commented Jan 12, 2020

Codecov Report

Merging #95 into testing will increase coverage by 8.39%.
The diff coverage is 71.96%.

Impacted file tree graph

@@             Coverage Diff             @@
##           testing      #95      +/-   ##
===========================================
+ Coverage    75.67%   84.06%   +8.39%     
===========================================
  Files           11       10       -1     
  Lines         1340     1205     -135     
===========================================
- Hits          1014     1013       -1     
+ Misses         326      192     -134
Impacted Files Coverage Δ
vidgear/gears/videogear.py 100% <100%> (ø) ⬆️
vidgear/gears/camgear.py 81.61% <62.5%> (+1.76%) ⬆️
vidgear/gears/stabilizer.py 92.91% <66.66%> (+0.17%) ⬆️
vidgear/gears/screengear.py 73.5% <66.66%> (+7.67%) ⬆️
vidgear/gears/netgear.py 80.64% <69.56%> (+0.58%) ⬆️
vidgear/gears/writegear.py 84.46% <75%> (+1.21%) ⬆️
vidgear/gears/helper.py 86.38% <78.57%> (-0.75%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e5bad4...eaa4fd8. Read the comment docs.

- defined logger for each API globally to avoid redundant clones.
- limited Imported OpenCV API version check scope to helper.py only.
- Fixed incorrect logic for pulling frames
- Added case for incorrect `color_space` value
@abhiTronix abhiTronix merged commit 4ea3c57 into testing Jan 12, 2020
@abhiTronix abhiTronix deleted the development branch January 12, 2020 13:31
@abhiTronix abhiTronix added SOLVED 🏁 This issue/PR is resolved now. Goal Achieved! and removed WORK IN PROGRESS 🚧 currently been worked on. labels Jan 12, 2020
@abhiTronix abhiTronix mentioned this pull request Apr 25, 2020
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ENHANCEMENT ⚡ New Feature/Addition/Improvement MAINTENANCE 🏗️ Just sorting things out! SOLVED 🏁 This issue/PR is resolved now. Goal Achieved!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants