Class: Lumberjack::DataDog::Config
- Inherits:
-
Object
- Object
- Lumberjack::DataDog::Config
- Defined in:
- lib/lumberjack/data_dog.rb
Instance Attribute Summary collapse
-
#allow_all_tags ⇒ Object
Returns the value of attribute allow_all_tags.
-
#backtrace_cleaner ⇒ Object
Returns the value of attribute backtrace_cleaner.
-
#max_message_length ⇒ Object
Returns the value of attribute max_message_length.
-
#pid ⇒ Object
Returns the value of attribute pid.
-
#pretty ⇒ Object
Returns the value of attribute pretty.
-
#tag_mapping ⇒ Object
readonly
Returns the value of attribute tag_mapping.
-
#thread_name ⇒ Object
Returns the value of attribute thread_name.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #remap_tags(tag_mapping) ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
22 23 24 25 26 27 28 29 30 |
# File 'lib/lumberjack/data_dog.rb', line 22 def initialize @max_message_length = nil @backtrace_cleaner = nil @thread_name = false @pid = true @allow_all_tags = true @tag_mapping = {} @pretty = false end |
Instance Attribute Details
#allow_all_tags ⇒ Object
Returns the value of attribute allow_all_tags.
18 19 20 |
# File 'lib/lumberjack/data_dog.rb', line 18 def @allow_all_tags end |
#backtrace_cleaner ⇒ Object
Returns the value of attribute backtrace_cleaner.
15 16 17 |
# File 'lib/lumberjack/data_dog.rb', line 15 def backtrace_cleaner @backtrace_cleaner end |
#max_message_length ⇒ Object
Returns the value of attribute max_message_length.
14 15 16 |
# File 'lib/lumberjack/data_dog.rb', line 14 def @max_message_length end |
#pid ⇒ Object
Returns the value of attribute pid.
17 18 19 |
# File 'lib/lumberjack/data_dog.rb', line 17 def pid @pid end |
#pretty ⇒ Object
Returns the value of attribute pretty.
20 21 22 |
# File 'lib/lumberjack/data_dog.rb', line 20 def pretty @pretty end |
#tag_mapping ⇒ Object (readonly)
Returns the value of attribute tag_mapping.
19 20 21 |
# File 'lib/lumberjack/data_dog.rb', line 19 def tag_mapping @tag_mapping end |
#thread_name ⇒ Object
Returns the value of attribute thread_name.
16 17 18 |
# File 'lib/lumberjack/data_dog.rb', line 16 def thread_name @thread_name end |
Instance Method Details
#remap_tags(tag_mapping) ⇒ Object
32 33 34 |
# File 'lib/lumberjack/data_dog.rb', line 32 def (tag_mapping) @tag_mapping = @tag_mapping.merge(tag_mapping) end |
#validate! ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/lumberjack/data_dog.rb', line 36 def validate! if !.nil? && (!.is_a?(Integer) || <= 0) raise ArgumentError, "max_message_length must be a positive integer" end unless backtrace_cleaner.nil? || backtrace_cleaner.respond_to?(:clean) raise ArgumentError, "backtrace_cleaner must respond to #clean" end end |