Sha256: f13935694dc1c874af1a1eed73514aac8c969eb26e9e3a25030452ddc10bb5c5

Contents?: true

Size: 639 Bytes

Versions: 4

Compression:

Stored size: 639 Bytes

Contents

module EasyProfiler
  # A logger used to output logs to the Firebug console.
  #
  # Based on http://rails.aizatto.com/category/plugins/firebug-logger/
  class FirebugLogger
    attr_accessor :logs
    
    def initialize #:nodoc:
      @logs = []
    end

    # Clear the logs.
    def clear
      @logs = []
    end

    # Adds a line to the log.
    #
    # == arguments
    # * +message+ -- log message to be logged
    # * +block+  -- optional. Return value of the block will be the message that will be logged.
    def info(message = nil)
      message = yield if message.nil? && block_given?
      @logs << message
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
easy-prof-1.1.2 lib/easy_prof/firebug_logger.rb
easy-prof-1.1.1 lib/easy_prof/firebug_logger.rb
easy-prof-1.1.0 lib/easy_prof/firebug_logger.rb
easy-prof-1.0.0 lib/easy_profiler/firebug_logger.rb