steve8x8 / geotoad

Geocaching query tool written in Ruby
https://buymeacoffee.com/steve8x8
Other
28 stars 8 forks source link

Address issue 144: debug level values >1 #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

I have started to change GeoToad to allow for different debugging levels.
My vision is to have 4 of them, 1 for basic informative stuff, 2 for details, 
3 for a call stack, and 4 for long text manipulations.
All "debug" statements will have to be rewritten into "ndebug" ones, which
is a rather tedious task. "debug" implies "ndebug 1" behaviour.
Using the "verbose" option, one may limit debugging output (as before).

This is a suggestion, and I'm open for discussion before I start the
conversion debug->ndebug.

Original issue reported on code.google.com by Steve8x8 on 11 Jan 2011 at 3:58

GoogleCodeExporter commented 9 years ago
To get the sample command line (presented by the TUI) right, the following 
patch has to be applied:

--- input.rb.ORIG   2011-01-11 16:45:25.000000000 +0100
+++ input.rb    2011-01-12 09:04:58.000000000 +0100
@@ -185,6 +185,10 @@
         if option == 'queryType' and @@optHash[option] == 'location'
           next
         end
+        if option == 'verbose'
+          cmdline = cmdline + " --verbose" * @@optHash[option]
+          next
+        end

         if @@optHash[option] == 'X'
           cmdline = cmdline + " --#{option}"

Original comment by Steve8x8 on 12 Jan 2011 at 8:06

GoogleCodeExporter commented 9 years ago

Original comment by Steve8x8 on 1 Apr 2011 at 2:08