Opened 8 years ago

Last modified 5 years ago

#2967 new enhancement

[PATCH] Super quiet mode

Reported by: rouault Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Parser Version: svn-trunk
Keywords: patch Cc:
CPU: Unspecified Platform: Unspecified

Description

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.

Attachments (1)

superquiet.patch (1.4 KB ) - added by rouault 8 years ago.

Download all attachments as: .zip

Change History (17)

by rouault, 8 years ago

Attachment: superquiet.patch added

comment:1 by rouault, 8 years ago

Type: defectenhancement

comment:2 by rouault, 8 years ago

Summary: Super quiet mode[PATCH] Super quiet mode

in reply to:  description ; comment:3 by mlennert, 8 years ago

Replying to 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 r68092 for further testing.

in reply to:  3 comment:4 by wenzeslaus, 8 years ago

Component: DefaultParser
Keywords: patch added
Milestone: 7.0.47.1.0
Version: unspecifiedsvn-trunk

Replying to mlennert:

Replying to 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 r68092 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.

in reply to:  description comment:5 by glynn, 8 years ago

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

comment:6 by neteler, 8 years ago

Milestone: 7.1.07.2.0

Milestone renamed

comment:7 by neteler, 7 years ago

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:8 by martinl, 7 years ago

Milestone: 7.2.17.2.2

comment:9 by martinl, 7 years ago

Milestone: 7.2.27.4.0

All enhancement tickets should be assigned to 7.4 milestone.

comment:10 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:11 by martinl, 6 years ago

What is status of this issue?

in reply to:  11 comment:12 by mlennert, 6 years ago

Replying to 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 ?

comment:13 by neteler, 6 years ago

Milestone: 7.4.17.4.2

comment:14 by martinl, 6 years ago

Milestone: 7.4.27.6.0

All enhancement tickets should be assigned to 7.6 milestone.

comment:15 by martinl, 5 years ago

Milestone: 7.6.07.6.1

Ticket retargeted after milestone closed

comment:16 by martinl, 5 years ago

Milestone: 7.6.17.6.2

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.