Class: Object

Inherits:
BasicObject
Defined in:
lib/vapir-firefox/jssh_socket.rb

Overview

class LoggerWithCallstack < Logger

class TimeElapsedFormatter < Formatter
  def initialize
    super
    @time_started=Time.now
  end
  def format_datetime(time)
    "%10.3f"%(time.to_f-@time_started.to_f)
  end

end
def add(severity, message = nil, progname = nil, &block)
  severity ||= UNKNOWN
  if @logdev.nil? or severity < @level
    return true
  end
  progname ||= @progname
  if message.nil?
    if block_given?
      message = yield
    else
      message = progname
      progname = @progname
    end
  end
  message=message.to_s+" FROM: "+caller.map{|c|"\t\t#{c}\n"}.join("")
  @logdev.write(
    format_message(format_severity(severity), Time.now, progname, message))
  true
end

end

Instance Method Summary collapse

Instance Method Details

#to_jsshObject

this is like #to_json, but without the conflicting names between ActiveSupport and JSON gem, and also for JsshObject (which is a reference; not real json; see the overload in that class)



42
43
44
# File 'lib/vapir-firefox/jssh_socket.rb', line 42

def to_jssh
  ActiveSupport::JSON.encode(self)
end