Class: Config
- Inherits:
-
Object
- Object
- Config
- Defined in:
- lib/debugtrace/config.rb
Instance Method Summary collapse
- #bytes_count_in_line ⇒ Object
- #bytes_limit ⇒ Object
- #collection_limit ⇒ Object
- #config_path ⇒ Object
- #count_format ⇒ Object
- #cyclic_reference_string ⇒ Object
- #data_indent_string ⇒ Object
- #enabled? ⇒ Boolean
- #enter_format ⇒ Object
- #indent_string ⇒ Object
-
#initialize(config_path) ⇒ Config
constructor
A new instance of Config.
- #key_value_separator ⇒ Object
- #leave_format ⇒ Object
- #length_format ⇒ Object
- #limit_string ⇒ Object
- #logger_name ⇒ Object
- #logging_datetime_format ⇒ Object
- #logging_destination ⇒ Object
- #logging_format ⇒ Object
- #maximum_data_output_width ⇒ Object
- #maximum_indents ⇒ Object
- #minimum_output_count ⇒ Object
- #minimum_output_length ⇒ Object
- #non_output_string ⇒ Object
- #print_suffix_format ⇒ Object
- #reflection_nest_limit ⇒ Object
- #string_limit ⇒ Object
- #thread_boundary_format ⇒ Object
- #varname_value_separator ⇒ Object
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_line ⇒ Object
67 |
# File 'lib/debugtrace/config.rb', line 67 def bytes_count_in_line ; @bytes_count_in_line ; end |
#bytes_limit ⇒ Object
69 |
# File 'lib/debugtrace/config.rb', line 69 def bytes_limit ; @bytes_limit ; end |
#collection_limit ⇒ Object
68 |
# File 'lib/debugtrace/config.rb', line 68 def collection_limit ; @collection_limit ; end |
#config_path ⇒ Object
44 |
# File 'lib/debugtrace/config.rb', line 44 def config_path ; @config_path ; end |
#count_format ⇒ Object
62 |
# File 'lib/debugtrace/config.rb', line 62 def count_format ; @count_format ; end |
#cyclic_reference_string ⇒ Object
58 |
# File 'lib/debugtrace/config.rb', line 58 def cyclic_reference_string ; @cyclic_reference_string ; end |
#data_indent_string ⇒ Object
55 |
# File 'lib/debugtrace/config.rb', line 55 def data_indent_string ; @data_indent_string ; end |
#enabled? ⇒ Boolean
49 |
# File 'lib/debugtrace/config.rb', line 49 def enabled? ; @enabled ; end |
#enter_format ⇒ Object
50 |
# File 'lib/debugtrace/config.rb', line 50 def enter_format ; @enter_format ; end |
#indent_string ⇒ Object
54 |
# File 'lib/debugtrace/config.rb', line 54 def indent_string ; @indent_string ; end |
#key_value_separator ⇒ Object
60 |
# File 'lib/debugtrace/config.rb', line 60 def key_value_separator ; @key_value_separator ; end |
#leave_format ⇒ Object
51 |
# File 'lib/debugtrace/config.rb', line 51 def leave_format ; @leave_format ; end |
#length_format ⇒ Object
64 |
# File 'lib/debugtrace/config.rb', line 64 def length_format ; @length_format ; end |
#limit_string ⇒ Object
56 |
# File 'lib/debugtrace/config.rb', line 56 def limit_string ; @limit_string ; end |
#logger_name ⇒ Object
45 |
# File 'lib/debugtrace/config.rb', line 45 def logger_name ; @logger_name ; end |
#logging_datetime_format ⇒ Object
48 |
# File 'lib/debugtrace/config.rb', line 48 def logging_datetime_format ; @logging_datetime_format ; end |
#logging_destination ⇒ Object
46 |
# File 'lib/debugtrace/config.rb', line 46 def logging_destination ; @logging_destination ; end |
#logging_format ⇒ Object
47 |
# File 'lib/debugtrace/config.rb', line 47 def logging_format ; @logging_format ; end |
#maximum_data_output_width ⇒ Object
66 |
# File 'lib/debugtrace/config.rb', line 66 def maximum_data_output_width; @maximum_data_output_width; end |
#maximum_indents ⇒ Object
53 |
# File 'lib/debugtrace/config.rb', line 53 def maximum_indents ; @maximum_indents ; end |
#minimum_output_count ⇒ Object
63 |
# File 'lib/debugtrace/config.rb', line 63 def minimum_output_count ; @minimum_output_count ; end |
#minimum_output_length ⇒ Object
65 |
# File 'lib/debugtrace/config.rb', line 65 def minimum_output_length ; @minimum_output_length ; end |
#non_output_string ⇒ Object
57 |
# File 'lib/debugtrace/config.rb', line 57 def non_output_string ; @non_output_string ; end |
#print_suffix_format ⇒ Object
61 |
# File 'lib/debugtrace/config.rb', line 61 def print_suffix_format ; @print_suffix_format ; end |
#reflection_nest_limit ⇒ Object
71 |
# File 'lib/debugtrace/config.rb', line 71 def reflection_nest_limit ; @reflection_nest_limit ; end |
#string_limit ⇒ Object
70 |
# File 'lib/debugtrace/config.rb', line 70 def string_limit ; @string_limit ; end |
#thread_boundary_format ⇒ Object
52 |
# File 'lib/debugtrace/config.rb', line 52 def thread_boundary_format ; @thread_boundary_format ; end |
#varname_value_separator ⇒ Object
59 |
# File 'lib/debugtrace/config.rb', line 59 def varname_value_separator ; @varname_value_separator ; end |