NCAS-CMS / NCAS-CMS/cf-plot

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

Open
#41 0 comments 0 reactions 1 assignee View on GitHub

@sadielbartholomew is already working on this.

Since Mar 25, 2024.

enhancement
Dominant language
Python
Stars
21
Forks
11
Avg merge
7h 11m
Merged PRs (30d)
1

Description

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:

https://github.com/NCAS-CMS/cf-plot/blob/a325942415561e5a22773715ff3946e1416094f7/cfplot/cfplot.py#L1122-L1128

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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.