Sha256: a3b5523c7ecc8b44b04b38b7ce153ae341815b7f9a2b31fddd78a9e1f72fa47d

Contents?: true

Size: 464 Bytes

Versions: 12

Compression:

Stored size: 464 Bytes

Contents

module Coprl
  module Trace
    include Coprl::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

12 entries across 12 versions & 1 rubygems

Version Path
coprl-3.0.0.beta.12 lib/coprl/trace.rb
coprl-3.0.0.beta.11 lib/coprl/trace.rb
coprl-3.0.0.beta.10 lib/coprl/trace.rb
coprl-3.0.0.beta.9 lib/coprl/trace.rb
coprl-3.0.0.beta.8 lib/coprl/trace.rb
coprl-3.0.0.beta.7 lib/coprl/trace.rb
coprl-3.0.0.beta.6 lib/coprl/trace.rb
coprl-3.0.0.beta.5 lib/coprl/trace.rb
coprl-3.0.0.beta.4 lib/coprl/trace.rb
coprl-3.0.0.beta.3 lib/coprl/trace.rb
coprl-3.0.0.beta.2 lib/coprl/trace.rb
coprl-3.0.0.beta.1 lib/coprl/trace.rb