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

in PrePARE, logfile-friendly output format #534

Closed
alaniwi opened this issue Aug 10, 2019 · 2 comments · Fixed by #588
Closed

in PrePARE, logfile-friendly output format #534

alaniwi opened this issue Aug 10, 2019 · 2 comments · Fixed by #588

Comments

@alaniwi
Copy link

alaniwi commented Aug 10, 2019

Example output of PrePARE as it appears when redrected to a file and displayed with less:

ESC[1;32m^MCheck netCDF file(s): ESC[0m12% | 1/8 filesESC[1;32m^MCheck netCDF fi
le(s): ESC[0m25% | 2/8 filesESC[1;32m^MCheck netCDF file(s): ESC[0m37% | 3/8 fil
esESC[1;32m^MCheck netCDF file(s): ESC[0m50% | 4/8 filesESC[1;32m^MCheck netCDF 
file(s): ESC[0m62% | 5/8 filesESC[1;32m^MCheck netCDF file(s): ESC[0m75% | 6/8 f
ilesESC[1;32m^MCheck netCDF file(s): ESC[0m87% | 7/8 filesESC[1;32m^MCheck netCD
F file(s): ESC[0m100% | 8/8 files^MESC[KESC[1;31;47m
================================================================================
=====
The variable ua could not be found in file
================================================================================
=====
ESC[0m
ESC[95m
Number of files scanned: 8ESC[0mESC[1;31;47m
Number of file with error(s): 1ESC[0m

It would be good to suppress the colours and progress meter when stdout is not a terminal, in order to get something like this instead (this suggestion also includes the filename, based on #533):

Error(s) in: ua_Amon_SomeModel_piControl_r1i1p1f1_gn_123456-234567.nc
   The variable ua could not be found in file
Number of files scanned: 8
Number of file with error(s): 1

Thanks.

@durack1
Copy link
Contributor

durack1 commented Aug 11, 2019

@alaniwi thanks for raising these requests (this, plus #533, #532). As an FYI, PrePARE is included in this repo (see PrePARE.py). We welcome pull requests with your suggestd code enhancements, which will lead to a much faster turnaround than waiting for these requests to be implemented at LLNL

@alaniwi
Copy link
Author

alaniwi commented Aug 13, 2019

Noted, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
3.6.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants