Sha256: a504744e4d2d0d2c36c8fd6646fd20374973a3dfc94c99804ba1ea0042c61a4c

Contents?: true

Size: 776 Bytes

Versions: 3

Compression:

Stored size: 776 Bytes

Contents

require 'sinatra/base'
require 'web_tools'
require 'web_tools/support/app_model'
require 'web_tools/support/service_helper'
require 'maglev/objectlog'

class WebTools::ObjectLog < WebTools::Tool
  get '/' do
    list = ObjectLog.to_ary.reverse.collect do |entry|
      label = "#{entry.label}"
      object_str = "#{entry.object}"
      label = label.split.first if label == object_str
      { "oop" => entry.object_id,
        "stamp" => entry.timestamp.to_s,
        "pid" => entry.pid.to_s,
        "label" => label,
        "type" => %w[Fatal Error Warn Info Debug Trace Transcript][entry.priority-1],
        "tag" => "#{entry.tag if entry.tagged?}",
        "object" => object_str,
        "hasContinuation" => entry.has_cc? }
    end
    json("list" => list)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
maglev-webtools-1.0.2 lib/web_tools/object_log.rb
maglev-webtools-1.0.1 lib/web_tools/object_log.rb
maglev-webtools-1.0 lib/web_tools/object_log.rb