Method: DebugLogging::Configuration#initialize

Defined in:
lib/debug_logging/configuration.rb

#initialize(**options) ⇒ Configuration

Returns a new instance of Configuration.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/debug_logging/configuration.rb', line 54

def initialize(**options)
  @enabled = options.key?(:enabled) ? options[:enabled] : true
  @logger = options.key?(:logger) ? options[:logger] : Logger.new($stdout)
  @log_level = options.key?(:log_level) ? options[:log_level] : :debug
  @multiple_last_hashes = options.key?(:multiple_last_hashes) ? options[:multiple_last_hashes] : false
  @last_hash_to_s_proc = options.key?(:last_hash_to_s_proc) ? options[:last_hash_to_s_proc] : nil
  @last_hash_max_length = options.key?(:last_hash_max_length) ? options[:last_hash_max_length] : 1_000
  @args_max_length = options.key?(:args_max_length) ? options[:args_max_length] : 1_000
  @instance_benchmarks = options.key?(:instance_benchmarks) ? options[:instance_benchmarks] : false
  @class_benchmarks = options.key?(:class_benchmarks) ? options[:class_benchmarks] : false
  @colorized_chain_for_method = options.key?(:colorized_chain_for_method) ? options[:colorized_chain_for_method] : false
  @colorized_chain_for_class = options.key?(:colorized_chain_for_class) ? options[:colorized_chain_for_class] : false
  @add_invocation_id = options.key?(:add_invocation_id) ? options[:add_invocation_id] : true
  @ellipsis = options.key?(:ellipsis) ? options[:ellipsis] : DEFAULT_ELLIPSIS
  @mark_scope_exit = options.key?(:mark_scope_exit) ? options[:mark_scope_exit] : false
  @methods_to_log = []
end