Class: SelectRailsLog::Printer::JsonPrinter

Inherits:
BasePrinter show all
Includes:
DataSerializable
Defined in:
lib/select_rails_log/printer/json_printer.rb

Constant Summary collapse

SUFFIX =
".json"

Constants included from DataSerializable

DataSerializable::DATETIME_FORMAT

Constants included from Constants

Constants::ACTION, Constants::CLIENT, Constants::COMPLETED, Constants::CONTROLLER, Constants::DEBUG, Constants::DEFAULT_OUTPUT, Constants::DURATION, Constants::HTTP_METHOD, Constants::HTTP_STATUS, Constants::ID, Constants::INTERVAL, Constants::LOGS, Constants::MESSAGE, Constants::PARAMETERS, Constants::PATH, Constants::PERFORMANCE, Constants::PERFORMANCE_ACTIVE_RECORD, Constants::PERFORMANCE_ALLOCATIONS, Constants::PERFORMANCE_VIEWS, Constants::PID, Constants::RAW_LOGS, Constants::REQUEST_ID, Constants::SEVERITY, Constants::STARTED, Constants::TIME

Instance Attribute Summary

Attributes inherited from Extension

#options

Instance Method Summary collapse

Methods inherited from BasePrinter

#output_directory?, #output_stdout?, #print, #runnable?

Methods inherited from Extension

option_initializers, #runnable?

Constructor Details

#initialize ⇒ JsonPrinter

Returns a new instance of JsonPrinter.



16
17
18
19
# File 'lib/select_rails_log/printer/json_printer.rb', line 16

def initialize(...)
  super
  @no_output = true
end

Instance Method Details

#close ⇒ Object



21
22
23
24
# File 'lib/select_rails_log/printer/json_printer.rb', line 21

def close
  @output_file.puts "]" unless output_directory?
  super
end