maint: consolidate developer debug messages
commit3309e880fb2b5d4316809c5ceef4f5b2b8d34a38
authorPádraig Brady <P@draigBrady.com>
Sun, 10 Feb 2013 12:47:23 +0000 (10 12:47 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 10 Feb 2013 20:30:53 +0000 (10 20:30 +0000)
tree7f55499b883b230b4a8d550e2d340befe2d82e4e
parent71ab11eac1de965e90abf050bf1bbe22eb4ac7b9
maint: consolidate developer debug messages

Both factor and numfmt recently introduced debug messages
for developers, enabled by --verbose and ---devdebug respectively.
There were a few issues though:
 1. They used different mechanisms to enable these messages.
 2. factor used --verbose which might be needed for something else
 3. They used different methods to output the messages,
    and numfmt used error() which added an unwanted newline
 4. numfmt marked all these messages for translation and factor
    marked a couple.  We really don't need these translated.
So we fix the above issues here while renaming the enabling
option for both commands to ---debug (still undocumented).

* src/factor.c (verbose): Rename to dev_debug and change from int to
bool as it's just a toggle flag.
(long_options): Rename --verbose to ---debug.
* src/system.h (devmsg): A new inline function to output a message
if enabled by a global dev_debug variable in the compilation unit.
* src/numfmt.c: Use devmsg() rather than error().
Also remove the translation tags from these messages.
Also change debug flag to bool from int.
* tests/misc/numfmt.pl: Adjust for the ---devdebug to ---debug change.
* cfg.mk (sc_marked_devdiagnostics): Add a syntax check to ensure
translations are not added to devmsg calls.

Reported by Göran Uddeborg in http://bugs.gnu.org/13665
cfg.mk
src/factor.c
src/numfmt.c
src/system.h
tests/misc/numfmt.pl