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

Add logging to improve upon if verbose: print(<msg>) statments #41

Open
sadielbartholomew opened this issue Mar 25, 2024 · 0 comments
Open
Assignees

Comments

@sadielbartholomew
Copy link
Member

Use the Python built-in logging module to manage messaging to the user, in particular to add finer configurable granularity of detail and/or severity of said messages, and consolidate the code so that it doesn't have to wrap anything to print with if verbose statements, like so:

cf-plot/cfplot/cfplot.py

Lines 1122 to 1128 in a325942

if verbose:
if ptype == 2:
print('con - making a latitude-pressure plot')
if ptype == 3:
print('con - making a longitude-pressure plot')
if ptype == 7:
print('con - making a time-pressure plot')

As with cf-python, I think it would be useful also here to add another level as a custom one to extend the five provided, which indicates extra detail as opposed to just increased severity (see https://github.com/NCAS-CMS/cf-python/blob/de6d0b5cf9d52aa0d0302d76e68fdfab94a62004/cf/__init__.py#L359-L370).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant