-
Notifications
You must be signed in to change notification settings - Fork 28
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 logger config #313
Fix logger config #313
Conversation
Signed-off-by: pem70 <[email protected]>
Signed-off-by: pem70 <[email protected]>
Signed-off-by: pem70 <[email protected]>
Signed-off-by: pem70 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, thanks Peizhao!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #313 +/- ##
==========================================
- Coverage 90.03% 89.85% -0.19%
==========================================
Files 53 53
Lines 2751 2808 +57
==========================================
+ Hits 2477 2523 +46
- Misses 274 285 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: pem70 <[email protected]>
…nt-python-sdk into Fix-logger-config
Signed-off-by: pem70 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does resolve the problem of logging statements going to the python_sdk.log file 😋
I like the Log.close_[file/console]_output()
functions. 🙏🏽
Is it expected that any logging.[debug,info,error]("test")
will turn on console_output?(i.e. it's equivalent to running Log.open_console_output()
)
In contrast, the closeAll()
function keeps the logger disabled even after a logging.[xyz]()
call occurs.
Expand this section to vew a small test script
profile = ProfileManager().load(profile_type="zosmf", validate_schema=False)
ds = Datasets(profile)
console = Console(profile)
jobs = Jobs(profile)
Log.setAllLoggerLevel(logging.DEBUG)
# Log.closeAll() # Keeps console_output off
Log.close_console_output() # Gets enabled after a `logging.` call
# Log.close_file_output()
res = console.issue_command("D T") # You won't see a debug log in the console
print(res['cmd-response'])
logging.error("---- Test ----") # This turns on the consloe_output
res = ds.list('sys1.parmlib*') # You should not see a debug log in the console
for v in res["items"]:
print(v["dsname"])
Signed-off-by: pem70 <[email protected]>
It is not an expected behavior, and should be fixed with the update. |
Thank you for addressing the comment 😋 |
Release succeeded for the The following packages have been published:
Powered by Octorelease 🚀 |
What It Does
Fixes the bug the logger config would affect other Python application logger [#314].
How to Test
Review Checklist
I certify that I have:
Additional Comments