Class: Config

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

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$s'
  @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_nest_limit     = _get_config_value 'reflection_nest_limit'     , 4
end

Instance Method Details

#bytes_count_in_lineObject



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

def bytes_count_in_line      ; @bytes_count_in_line      ; end

#bytes_limitObject



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

def bytes_limit              ; @bytes_limit              ; end

#collection_limitObject



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

def collection_limit         ; @collection_limit         ; end

#config_pathObject



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

def config_path              ; @config_path              ; end

#count_formatObject



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

def count_format             ; @count_format             ; end

#cyclic_reference_stringObject



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

def cyclic_reference_string  ; @cyclic_reference_string  ; end

#data_indent_stringObject



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

def data_indent_string       ; @data_indent_string       ; end

#enabled?Boolean

Returns:

  • (Boolean)


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

def enabled?                 ; @enabled                  ; end

#enter_formatObject



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

def enter_format             ; @enter_format             ; end

#indent_stringObject



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

def indent_string            ; @indent_string            ; end

#key_value_separatorObject



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

def key_value_separator      ; @key_value_separator      ; end

#leave_formatObject



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

def leave_format             ; @leave_format             ; end

#length_formatObject



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

def length_format            ; @length_format            ; end

#limit_stringObject



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

def limit_string             ; @limit_string             ; end

#logger_nameObject



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

def logger_name              ; @logger_name              ; end

#logging_datetime_formatObject



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

def logging_datetime_format  ; @logging_datetime_format  ; end

#logging_destinationObject



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

def logging_destination      ; @logging_destination      ; end

#logging_formatObject



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

def logging_format           ; @logging_format           ; end

#maximum_data_output_widthObject



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

def maximum_data_output_width; @maximum_data_output_width; end

#maximum_indentsObject



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

def maximum_indents          ; @maximum_indents          ; end

#minimum_output_countObject



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

def minimum_output_count     ; @minimum_output_count     ; end

#minimum_output_lengthObject



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

def minimum_output_length    ; @minimum_output_length    ; end

#non_output_stringObject



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

def non_output_string        ; @non_output_string        ; end


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

def print_suffix_format      ; @print_suffix_format      ; end

#reflection_nest_limitObject



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

def reflection_nest_limit    ; @reflection_nest_limit    ; end

#string_limitObject



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

def string_limit             ; @string_limit             ; end

#thread_boundary_formatObject



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

def thread_boundary_format   ; @thread_boundary_format   ; end

#varname_value_separatorObject



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

def varname_value_separator  ; @varname_value_separator  ; end