landam / grass-gis-git-migration-test

0 stars 0 forks source link

[PATCH] Super quiet mode #202

Open landam opened 5 years ago

landam commented 5 years ago

Reported by rouault on 20 Mar 2016 21:35 UTC Some utilities like r.out.gdal can be rather verbose with warnings :

WARNING: Precision loss: Raster map <mean.blue> of type DCELL to be

         exported as UInt16. This can be avoided by using Float64.
WARNING: Forcing raster export.
WARNING: Unable to set projection

--quiet doesn't suppress those warnings. Setting GRASS_VERBOSE=-1 is a possibility, but this also suppresses fatal warnings, which is quite annoying.

The attached proposed patch adds a --qq option for a super verbose mode that suppress everything but fatal warnings.

GRASS GIS version and provenance

svn-trunk

Migrated-From: https://trac.osgeo.org/grass/ticket/2967

landam commented 5 years ago

Attachment from rouault on 20 Mar 2016 21:36 UTC

https://trac.osgeo.org/grass/attachment/ticket/2967/superquiet.patch

landam commented 5 years ago

Modified by rouault on 20 Mar 2016 21:45 UTC

landam commented 5 years ago

Modified by rouault on 21 Mar 2016 09:53 UTC

landam commented 5 years ago

Comment by mlennert on 21 Mar 2016 10:15 UTC Replying to [ticket:2967 rouault]:

Some utilities like r.out.gdal can be rather verbose with warnings :

WARNING: Precision loss: Raster map <mean.blue> of type DCELL to be

         exported as UInt16. This can be avoided by using Float64.
WARNING: Forcing raster export.
WARNING: Unable to set projection

--quiet doesn't suppress those warnings. Setting GRASS_VERBOSE=-1 is a possibility, but this also suppresses fatal warnings, which is quite annoying.

The attached proposed patch adds a --qq option for a super verbose mode that suppress everything but fatal warnings.

Thanks for the patch. I'm often annoyed by the same issue. I've committed your patch to trunk in https://trac.osgeo.org/grass/changeset/68092 for further testing.

landam commented 5 years ago

Comment by wenzeslaus on 24 Mar 2016 03:43 UTC Replying to [comment:3 mlennert]:

Replying to [ticket:2967 rouault]:

The attached proposed patch adds a --qq option for a super verbose mode that suppress everything but fatal warnings.

Thanks for the patch. I'm often annoyed by the same issue. I've committed your patch to trunk in https://trac.osgeo.org/grass/changeset/68092 for further testing.

--qq doesn't fit into the idea of shortening options/flags:

--verbose --v
--quiet   --q

This is applied automatically to the module options (e.g. input versus in) and although I'm not sure what is the mechanism for the long (standard/common) flags I think the general rules should be the same. So now --q is little ambiguous as it can stand for --quiet or --qq. Leaving aside that --qq doesn't have the long or short version.

I suggest to use --xquiet (X as in XS and XL). But perhaps there might be an way without letter X.

Please, make also some suggestions on how Python API should be extended, that's an important part of this change.

I tested the following

g.region -p --qq --verbose

and it goes though without any warning. I think the code disables warnings and then gives a warning.

landam commented 5 years ago

Comment by glynn on 26 Mar 2016 18:44 UTC Replying to [ticket:2967 rouault]:

The attached proposed patch adds a --qq option for a super verbose mode that suppress everything but fatal warnings.

The grass.script Python module will need an additional parameter on several functions (e.g. make_command() and anything which uses it).

But then it's getting to the point where those options should probably be replaced with a single verbosity= option (and just set GRASS_VERBOSE directly rather than using switches).

landam commented 5 years ago

Comment by neteler on 5 May 2016 14:08 UTC Milestone renamed

landam commented 5 years ago

Comment by neteler on 28 Dec 2016 15:04 UTC Ticket retargeted after milestone closed

landam commented 5 years ago

Modified by @landam on 5 May 2017 20:41 UTC

landam commented 5 years ago

Comment by @landam on 1 Sep 2017 20:28 UTC All enhancement tickets should be assigned to 7.4 milestone.

landam commented 5 years ago

Comment by neteler on 26 Jan 2018 11:40 UTC Ticket retargeted after milestone closed

landam commented 5 years ago

Comment by @landam on 28 Jan 2018 11:21 UTC What is status of this issue?

landam commented 5 years ago

Comment by mlennert on 6 Mar 2018 13:22 UTC Replying to [comment:11 martinl]:

What is status of this issue?

AFAIK, no one has touched this issue since. Since it wasn't largely announced I don't know how many people are actually aware of the --qq flag's existence. So no one has hit the choice of --qq as name as a problem in conflict with the convention of shortening flags.

IIUC, the most sustainable option would be to follow Glynn's suggestion and replace the --q, --v and --qq flags with a generalized verbose= parameter which the user can set to any of the values accepted by GRASS_VERBOSE. But I imagine this implies seriously rewriting of the parser ?

landam commented 5 years ago

Modified by neteler on 12 Jun 2018 20:48 UTC

landam commented 5 years ago

Comment by @landam on 25 Sep 2018 16:52 UTC All enhancement tickets should be assigned to 7.6 milestone.

landam commented 5 years ago

Comment by @landam on 25 Jan 2019 21:07 UTC Ticket retargeted after milestone closed