Method: Ougai::Formatters::Readable#initialize

Defined in:
lib/ougai/formatters/readable.rb

#initialize(app_name = nil, hostname = nil, opts = {}) ⇒ Readable

Intialize a formatter

Options Hash (opts):

  • :trace_indent (String) — default: 4

    the value of trace_indent attribute

  • :trace_max_lines (String) — default: 100

    the value of trace_max_lines attribute

  • :plain (String) — default: false

    the value of plain attribute

  • :excluded_fields (String) — default: []

    the value of excluded_fields attribute

Parameters:

  • (defaults to: nil)

    application name (execution program name if nil)

  • (defaults to: nil)

    hostname (hostname if nil)

  • (defaults to: {})

    the initial values of attributes



21
22
23
24
25
26
27
28
29
# File 'lib/ougai/formatters/readable.rb', line 21

def initialize(app_name = nil, hostname = nil, opts = {})
  aname, hname, opts = Base.parse_new_params([app_name, hostname, opts])
  super(aname, hname, opts)
  @trace_indent = opts.fetch(:trace_indent, 4)
  @plain = opts.fetch(:plain, false)
  @excluded_fields = opts[:excluded_fields] || []
  @serialize_backtrace = true
  load_dependent
end