-
Notifications
You must be signed in to change notification settings - Fork 4
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
Bugs related to logger #256
Comments
OK, to provide some additional context here, I think we need to take a look at the code that redirects printing to standard out in subprocess.py. benchcab/benchcab/utils/subprocess.py Lines 60 to 80 in 9482458
I think that we can basically remove the bits that do the standard out catches of print statements and fall back onto using the native subprocess functionality to capture output from commands. Now that I have a better understanding of this issue, prefixing @SeanBryan51 can probably provide additional context here, as I believe he is most suited to comment being the author of this chunk of code. With these comments added, I am going to un-assign myself as I am working on other tasks and I'm not sure when I'll be available to work on this one - particularly if it becomes a blocker. @ccarouge, please feel free to re-assign me if needed. It isn't a great deal of work to address this issue. |
I think the redirection of subprocess output to stdout was done so that buffering the output wasn't required (this lets us see the output of subprocess commands in real time): benchcab/benchcab/utils/subprocess.py Line 77 in 9482458
If the intention is to redirect the subprocess output to the logger, this SO post might be relevant: https://stackoverflow.com/questions/21953835/run-subprocess-and-print-output-to-logging I'm not too sure exactly what the context is for this issue so I'm not sure if this helps, @abhaasgoyal can you update the issue description? |
@SeanBryan51 I have added the description for the issue. Let me know if anything's unclear. |
As of now, the logger is not being used properly in the codebase / has existing bugs.
Current issues
pbs.py
has verbose as a parameter, which would currently always be false. See Add payu test suite for spatial configuration #136 (comment) for the appropriate steps.subprocess.py
is currently usingprint
, when it should either be using logger / printing the command during thesubprocess
itself / other solutions. See DRAFT: Redesign test_subprocess logic #253 (comment) for a potential solution (which prints the command withinsubprocess.py
usingset -ex
. A better method could be printing the command in the logger only. While implementing the solution, the corresponding tests could usecaplog
instead of capturing fromcapfd
(they only check for file descriptors 1 and 2 and not the output from logger by default)benchcab
without-v
is still providingDEBUG
log output. #280The text was updated successfully, but these errors were encountered: