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

🧑‍💻 Maintenance: Log current vidgear version when vidgear APIs are called, not at import. (Fixes #338) #348

Merged
merged 3 commits into from
Jan 4, 2023

Conversation

abhiTronix
Copy link
Owner

@abhiTronix abhiTronix commented Jan 4, 2023

Brief Description

This PR will add functionality to log current vidgear version once only when vidgear APIs are called, not at import. Less clutter in logs.

Requirements / Checklist

Related Issue

#338
#340

Context

This PR is aimed at reducing unnecessary logging of vidgear current version on importing its APIs. With this PR, user can now completely turn off logging and moreover APIs with logging turned on (logging=True) will automatically log version only once when called within code, thus serving both purposes.

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)

…lled, not at import (Fixes #338)

- ✨ Added `logcurr_vidgear_ver` helper function to facilitate logging current vidgear version, when called within a API.
- 🔇 Implemented `ver_is_logged` global variable to log version only once, modifiable only with `logcurr_vidgear_ver`, and finally made it available in all APIs.
- 🧑‍💻 Followed recommendation given in official python docs: https://docs.python.org/3/faq/programming.html#how-do-i-share-global-variables-across-modules
- ⚡️ Current vidgear version can only be logged by APIs with its logging enabled.
- 🔥 Removed unnecessary imports.
…ming `output` value as valid path.

- 👷 Added v4l2loopback support for testing `/dev/video0` device on Linux machines.
- ☂️ Increased coverage.
@abhiTronix abhiTronix added ENHANCEMENT ⚡ New Feature/Addition/Improvement MAINTENANCE 🏗️ Just sorting things out! WORK IN PROGRESS 🚧 currently been worked on. PENDING TESTS 🧪 Waiting for CI tests to complete successfully. labels Jan 4, 2023
@abhiTronix abhiTronix added this to the v0.3.0 milestone Jan 4, 2023
@abhiTronix abhiTronix self-assigned this Jan 4, 2023
@abhiTronix abhiTronix added this to In progress in VidGear v0.3.0 via automation Jan 4, 2023
@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Base: 94.41% // Head: 94.65% // Increases project coverage by +0.24% 🎉

Coverage data is based on head (9fa1e8d) compared to base (9eedb09).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           testing     #348      +/-   ##
===========================================
+ Coverage    94.41%   94.65%   +0.24%     
===========================================
  Files           16       16              
  Lines         3116     3125       +9     
===========================================
+ Hits          2942     2958      +16     
+ Misses         174      167       -7     
Impacted Files Coverage Δ
vidgear/gears/asyncio/helper.py 99.18% <100.00%> (-0.02%) ⬇️
vidgear/gears/asyncio/netgear_async.py 90.11% <100.00%> (+0.03%) ⬆️
vidgear/gears/asyncio/webgear.py 98.75% <100.00%> (+<0.01%) ⬆️
vidgear/gears/asyncio/webgear_rtc.py 94.97% <100.00%> (+0.02%) ⬆️
vidgear/gears/camgear.py 95.12% <100.00%> (+0.02%) ⬆️
vidgear/gears/helper.py 94.11% <100.00%> (+0.04%) ⬆️
vidgear/gears/netgear.py 93.63% <100.00%> (ø)
vidgear/gears/pigear.py 100.00% <100.00%> (ø)
vidgear/gears/screengear.py 90.51% <100.00%> (ø)
vidgear/gears/stabilizer.py 98.57% <100.00%> (+0.01%) ⬆️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@abhiTronix abhiTronix merged commit 4f7a3af into testing Jan 4, 2023
VidGear v0.3.0 automation moved this from In progress to Done Jan 4, 2023
@abhiTronix abhiTronix deleted the development branch January 4, 2023 12:38
@abhiTronix abhiTronix added SOLVED 🏁 This issue/PR is resolved now. Goal Achieved! and removed WORK IN PROGRESS 🚧 currently been worked on. PENDING TESTS 🧪 Waiting for CI tests to complete successfully. labels Jan 4, 2023
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
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant