Module: Blab::Config
Constant Summary collapse
- DATETIME_FORMAT =
"%H:%M:%S.%L"
- DEFAULT_OUTPUT =
[ { type: :time, order: 1, width: 12 }, { type: :event, order: 2, width: 6 }, { type: :file_lines, order: 3, width: 50 }, #{ type: :class_name, order: 4, width: 10 }, #{ type: :method_name, order: 5, width: 12 }, { type: :code_lines, order: 5, width: 120 } ].freeze
Instance Attribute Summary collapse
- #datetime_format ⇒ Object
- #log_output ⇒ Object
- #logger ⇒ Object
-
#original_scope_only ⇒ Object
writeonly
Sets the attribute original_scope_only.
- #output_config ⇒ Object
- #output_order ⇒ Object
-
#trace_c_calls ⇒ Object
writeonly
Sets the attribute trace_c_calls.
Instance Method Summary collapse
Instance Attribute Details
#datetime_format ⇒ Object
48 49 50 |
# File 'lib/blab/config.rb', line 48 def datetime_format @datetime_format ||= DATETIME_FORMAT end |
#log_output ⇒ Object
36 37 38 |
# File 'lib/blab/config.rb', line 36 def log_output @log_output ||= STDOUT end |
#logger ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/blab/config.rb', line 28 def logger @logger ||= begin logger = Logger.new(log_output) logger.formatter = proc { |severity, datetime, progname, msg| "#{msg}\n" } logger end end |
#original_scope_only=(value) ⇒ Object (writeonly)
Sets the attribute original_scope_only
20 21 22 |
# File 'lib/blab/config.rb', line 20 def original_scope_only=(value) @original_scope_only = value end |
#output_config ⇒ Object
44 45 46 |
# File 'lib/blab/config.rb', line 44 def output_config @output_config ||= output_order.sort_by { |h| h[:order] }.map! { |h| [h[:type], h[:width]] } end |
#output_order ⇒ Object
40 41 42 |
# File 'lib/blab/config.rb', line 40 def output_order @output_order ||= DEFAULT_OUTPUT end |
#trace_c_calls=(value) ⇒ Object (writeonly)
Sets the attribute trace_c_calls
20 21 22 |
# File 'lib/blab/config.rb', line 20 def trace_c_calls=(value) @trace_c_calls = value end |
Instance Method Details
#original_scope_only? ⇒ Boolean
56 57 58 |
# File 'lib/blab/config.rb', line 56 def original_scope_only? @original_scope_only ||= false end |
#trace_c_calls? ⇒ Boolean
52 53 54 |
# File 'lib/blab/config.rb', line 52 def trace_c_calls? @trace_c_calls ||= false end |