fix: read the log file env var when checking for the off value - #211
Open
galjos wants to merge 1 commit into
Open
fix: read the log file env var when checking for the off value#211galjos wants to merge 1 commit into
galjos wants to merge 1 commit into
Conversation
The log file check dereferenced logging_env_var instead of log_file_env_var, so setting PQANALYSIS_LOG_FILE without PQANALYSIS_LOGGING_LEVEL raised AttributeError on None and made import PQAnalysis fail entirely. The typo also inverted the off sentinel: PQANALYSIS_LOG_FILE=off enabled logging to a file named off. Comparing the correct variable fixes both the crash and the sentinel.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #211 +/- ##
=======================================
Coverage 93.94% 93.94%
=======================================
Files 177 177
Lines 9227 9227
=======================================
Hits 8668 8668
Misses 559 559
🚀 New features to boost your workflow:
|
Contributor
|
PYLINT REPORT Your code has been rated at 9.78/10 Full reportRaw metrics
Duplication
Messages by category
% errors / warnings by module
Messages
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The off-sentinel check on line 58 read
logging_env_varinstead oflog_file_env_var, so setting onlyPQANALYSIS_LOG_FILEcrashed the import with an AttributeError, andPQANALYSIS_LOG_FILE=offlogged to a file namedoff. One-word fix.The added subprocess-based test covers the level-less, off, and named-file cases.
Fixes #210.