Class: Config

Inherits:
Object
  • Object
show all
Defined in:
lib/debugtrace/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_path) ⇒ Config

Returns a new instance of Config.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/debugtrace/config.rb', line 7

def initialize(config_path)
  @config_path = Common.check_type('config_path', config_path, String)
  if File.exist?(@config_path)
    @config = YAML.load_file(@config_path)
  else
    @config_path = '<No config file>'
    @config = nil
  end
  @logger_name               = _get_config_value 'logger'                    , 'stderr'
  @logging_destination       = _get_config_value 'logging_destination'       , 'STDERR'
  @logging_format            = _get_config_value 'logging_format'            , "%2$s %1$s %4$s\n"
  @logging_datetime_format   = _get_config_value 'logging_datetime_format'   , '%Y-%m-%d %H:%M:%S.%L%:z'
  @enabled                   = _get_config_value 'enabled'                   , true
  @enter_format              = _get_config_value 'enter_format'              , 'Enter %1$s (%2$s:%3$d) <- %4$s (%5$s:%6$d)'
  @leave_format              = _get_config_value 'leave_format'              , 'Leave %1$s (%2$s:%3$d) duration: %4$.3f ms'
  @thread_boundary_format    = _get_config_value 'thread_boundary_format'    , '______________________________ %1$s #%2$s ______________________________'
  @maximum_indents           = _get_config_value 'maximum_indents'           , 32
  @indent_string             = _get_config_value 'indent_string'             , '| '
  @data_indent_string        = _get_config_value 'data_indent_string'        , '  '
  @limit_string              = _get_config_value 'limit_string'              , '...'
  @non_output_string         = _get_config_value 'non_output_string'         , '...'
  @cyclic_reference_string   = _get_config_value 'cyclic_reference_string'   , '*** Cyclic Reference ***'
  @varname_value_separator   = _get_config_value 'varname_value_separator'   , ' = '
  @key_value_separator       = _get_config_value 'key_value_separator'       , ': '
  @print_suffix_format       = _get_config_value 'print_suffix_format'       , ' (%2$s:%3$d)'
  @count_format              = _get_config_value 'count_format'              , 'count:%d'
  @minimum_output_count      = _get_config_value 'minimum_output_count'      , 16
  @length_format             = _get_config_value 'length_format'             , 'length:%d'
  @minimum_output_length     = _get_config_value 'minimum_output_length'     , 16
  @maximum_data_output_width = _get_config_value 'maximum_data_output_width' , 70
  @bytes_count_in_line       = _get_config_value 'bytes_count_in_line'       , 16
  @collection_limit          = _get_config_value 'collection_limit'          , 128
  @bytes_limit               = _get_config_value 'bytes_limit'               , 256
  @string_limit              = _get_config_value 'string_limit'              , 256
  @reflection_limit          = _get_config_value 'reflection_limit'          , 4
end

Instance Attribute Details

#bytes_count_in_lineObject (readonly)

Returns the value of attribute bytes_count_in_line.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def bytes_count_in_line
  @bytes_count_in_line
end

#bytes_limitObject (readonly)

Returns the value of attribute bytes_limit.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def bytes_limit
  @bytes_limit
end

#collection_limitObject (readonly)

Returns the value of attribute collection_limit.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def collection_limit
  @collection_limit
end

#config_pathObject (readonly)

Returns the value of attribute config_path.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def config_path
  @config_path
end

#count_formatObject (readonly)

Returns the value of attribute count_format.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def count_format
  @count_format
end

#cyclic_reference_stringObject (readonly)

Returns the value of attribute cyclic_reference_string.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def cyclic_reference_string
  @cyclic_reference_string
end

#data_indent_stringObject (readonly)

Returns the value of attribute data_indent_string.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def data_indent_string
  @data_indent_string
end

#enter_formatObject (readonly)

Returns the value of attribute enter_format.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def enter_format
  @enter_format
end

#indent_stringObject (readonly)

Returns the value of attribute indent_string.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def indent_string
  @indent_string
end

#key_value_separatorObject (readonly)

Returns the value of attribute key_value_separator.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def key_value_separator
  @key_value_separator
end

#leave_formatObject (readonly)

Returns the value of attribute leave_format.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def leave_format
  @leave_format
end

#length_formatObject (readonly)

Returns the value of attribute length_format.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def length_format
  @length_format
end

#limit_stringObject (readonly)

Returns the value of attribute limit_string.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def limit_string
  @limit_string
end

#logger_nameObject (readonly)

Returns the value of attribute logger_name.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def logger_name
  @logger_name
end

#logging_datetime_formatObject (readonly)

Returns the value of attribute logging_datetime_format.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def logging_datetime_format
  @logging_datetime_format
end

#logging_destinationObject (readonly)

Returns the value of attribute logging_destination.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def logging_destination
  @logging_destination
end

#logging_formatObject (readonly)

Returns the value of attribute logging_format.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def logging_format
  @logging_format
end

#maximum_data_output_widthObject (readonly)

Returns the value of attribute maximum_data_output_width.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def maximum_data_output_width
  @maximum_data_output_width
end

#maximum_indentsObject (readonly)

Returns the value of attribute maximum_indents.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def maximum_indents
  @maximum_indents
end

#minimum_output_countObject (readonly)

Returns the value of attribute minimum_output_count.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def minimum_output_count
  @minimum_output_count
end

#minimum_output_lengthObject (readonly)

Returns the value of attribute minimum_output_length.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def minimum_output_length
  @minimum_output_length
end

#non_output_stringObject (readonly)

Returns the value of attribute non_output_string.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def non_output_string
  @non_output_string
end

Returns the value of attribute print_suffix_format.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def print_suffix_format
  @print_suffix_format
end

#reflection_limitObject (readonly)

Returns the value of attribute reflection_limit.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def reflection_limit
  @reflection_limit
end

#string_limitObject (readonly)

Returns the value of attribute string_limit.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def string_limit
  @string_limit
end

#thread_boundary_formatObject (readonly)

Returns the value of attribute thread_boundary_format.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def thread_boundary_format
  @thread_boundary_format
end

#varname_value_separatorObject (readonly)

Returns the value of attribute varname_value_separator.



44
45
46
# File 'lib/debugtrace/config.rb', line 44

def varname_value_separator
  @varname_value_separator
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


52
# File 'lib/debugtrace/config.rb', line 52

def enabled? = @enabled