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, = nil, progname = nil, &block)
severity ||= UNKNOWN
if @logdev.nil? or severity < @level
return true
end
progname ||= @progname
if .nil?
if block_given?
= yield
else
= progname
progname = @progname
end
end
=.to_s+" FROM: "+caller.map{|c|"\t\t#{c}\n"}.join("")
@logdev.write(
(format_severity(severity), Time.now, progname, ))
true
end
end
Instance Method Summary collapse
-
#to_jssh ⇒ Object
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).
Instance Method Details
#to_jssh ⇒ Object
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 |