RubyGems Navigation menu

dbg_tags 1.0.0

tags in your code can be switched on using features and levels. Examples: Tag.trc 'a message' # a :generic tag # All tags print sourcefile, current method and linenumber automatically Tag.trc # prints file, method and linenumber Tag.trc :feature, 'a message' # only called if :feature enabled. Tag.err 'msg' # Triggered when :generic feature is set to at # least :err level. # The levels are :err, :log, :trc, :val and :dtl, # in that order Tag.dtl :complex do "val = #{expensive.method.call}" end Tag.dtl(:complex) { "val = #{expensive.method.call}" } # use lazy evaluation with a block. # The block expression is printed using to_s. Tag.dtl(:complex) {} # same as Tag.dtl :complex # At the start of your application enable the desired dump-level. Tag.enable # Same as Tag.enable generic: :trc # That is enables levels <=:trc Tag.enable :val # enable :generic tags at <=:val levels Tag.enable :feature1, :feat2, ... # enables given features on <=:trc Tag.enable :feature1, :feat2, feat3: :dtl, all: :err # Set :feature1, :feat2, and :generic to <=:trc, :feat3 to :dtl # and ANY OTHER feature to only :err. Tag.enable feature: :err Tag.enable feature: :dtl # so ALL tags with feature :feature Tag.err(:feature) { raise 'aaaarg' if expensive_check_fails? }

Gemfile:
=

install:
=

Versions:

  1. 1.2.0 February 27, 2026 (10 KB)
  2. 1.1.2 June 06, 2024 (10 KB)
  3. 1.1.1 June 04, 2024 (9.5 KB)
  4. 1.1.0 May 06, 2024 (9 KB)
  5. 1.0.2 August 17, 2023 (8.5 KB)
  6. 1.0.0 March 24, 2022 (8 KB)
Show all versions (7 total)

Development Dependencies (3):

rake ~> 10.4
rspec ~> 3.4
simplecov ~> 0.18

Owners:

Pushed by:

Authors:

  • Eugene Brazwick

SHA 256 checksum:

=

Total downloads 3,754

For this version 1,299

Version Released:

License:

GPL-3.0

Required Ruby Version: >= 2.7

Links: