Sha256: e1e475392f3edc20f52c9f925fce82a4475e003f1d3a16cc01c4c3b31a4b9675

Contents?: true

Size: 462 Bytes

Versions: 6

Compression:

Stored size: 462 Bytes

Contents

module Voom
  module Trace
    include Voom::LoggerMethods

    private
    # Use a regex on your classes to enable debug logging
    # For example:
    # In your .env
    # export VOOM_TRACE_LOG_REGEX="^.*$"
    # In your code
    # trace {"What is it doing?" }
    def trace(&block)
      return unless ENV['VOOM_TRACE_LOG_REGEX']
      logger.info {"T:#{self.class}:#{block.call}"} if /#{ENV['VOOM_TRACE_LOG_REGEX']}/.match(self.class.name)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
voom-presenters-2.1.2 lib/voom/trace.rb
voom-presenters-2.1.0 lib/voom/trace.rb
voom-presenters-2.0.3 lib/voom/trace.rb
voom-presenters-2.0.2 lib/voom/trace.rb
voom-presenters-2.0.1 lib/voom/trace.rb
voom-presenters-2.0.0 lib/voom/trace.rb