Opened 9 years ago
Last modified 6 years ago
#2967 new enhancement
[PATCH] Super quiet mode
Reported by: | rouault | Owned by: | |
---|---|---|---|
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)
Change History (17)
by , 9 years ago
Attachment: | superquiet.patch added |
---|
comment:1 by , 9 years ago
Type: | defect → enhancement |
---|
comment:2 by , 9 years ago
Summary: | Super quiet mode → [PATCH] Super quiet mode |
---|
follow-up: 4 comment:3 by , 9 years ago
comment:4 by , 9 years ago
Component: | Default → Parser |
---|---|
Keywords: | patch added |
Milestone: | 7.0.4 → 7.1.0 |
Version: | unspecified → svn-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.
comment:5 by , 9 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:8 by , 8 years ago
Milestone: | 7.2.1 → 7.2.2 |
---|
comment:9 by , 7 years ago
Milestone: | 7.2.2 → 7.4.0 |
---|
All enhancement tickets should be assigned to 7.4 milestone.
comment:12 by , 7 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 , 7 years ago
Milestone: | 7.4.1 → 7.4.2 |
---|
comment:14 by , 6 years ago
Milestone: | 7.4.2 → 7.6.0 |
---|
All enhancement tickets should be assigned to 7.6 milestone.
Replying to rouault:
Thanks for the patch. I'm often annoyed by the same issue. I've committed your patch to trunk in r68092 for further testing.