Sha256: ce40939ca76b860d18fea28cc1e352d644b8cbb0ed39bc50cad1b11c08555195

Contents?: true

Size: 752 Bytes

Versions: 1

Compression:

Stored size: 752 Bytes

Contents

#require 'sourcify'

module Cello
  module Structure
    module LogHelper
      
      def logger(name, method, type, params=nil)
          ts = Time.now
         # wait_element_helper name
          left = yield
          params = "NONE" if params.nil?
          #binding.pry
          puts  "
         Element: #{name}
            Type: #{type} 
            Method: #{method} 
            Left #{left}
            Params: #{params}
            Code: #{yield} 
            => #{(Time.now - ts).round 4} seconds"
         left
      end
      
      def wait_element_helper(name)
        timeout = 1
        while !send("#{name}_exit_wait?") && time < timeout do
          sleep 0.1
          time += 0.1
        end
      end      

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cello-0.0.19 lib/cello/structure/html_elements/logger.rb