Sha256: b0ca46e92cc26ca559316e78f87c5fc7475c6af1401cfee2eb6e6f65ec34c160
Contents?: true
Size: 497 Bytes
Versions: 14
Compression:
Stored size: 497 Bytes
Contents
require_relative 'logger_methods' 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
14 entries across 14 versions & 1 rubygems