Class: ExceptionNotifier::TdNotifier
- Inherits:
-
Object
- Object
- ExceptionNotifier::TdNotifier
- Defined in:
- lib/exception_notifier/td_notifier.rb
Constant Summary collapse
- BACKTRACE_LIMIT_DEFAULT =
10
Instance Attribute Summary collapse
-
#backtrace_limit ⇒ Object
readonly
Returns the value of attribute backtrace_limit.
-
#custom_param_proc ⇒ Object
readonly
Returns the value of attribute custom_param_proc.
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
- #call(exception, options = {}) ⇒ Object
-
#initialize(options) ⇒ TdNotifier
constructor
A new instance of TdNotifier.
Constructor Details
#initialize(options) ⇒ TdNotifier
Returns a new instance of TdNotifier.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/exception_notifier/td_notifier.rb', line 9 def initialize() @table_name = .delete(:table_name) raise "Please set table_name. options: #{.inspect}" unless @table_name @backtrace_limit = .delete(:backtrace_limit) || BACKTRACE_LIMIT_DEFAULT @custom_param_proc = .delete(:custom_param_proc) unless defined? TreasureData::Logger::Agent::Rails @database = .delete(:database) raise "Please set database. options: #{.inspect}" unless @database TreasureData::Logger.open(@database, ) end end |
Instance Attribute Details
#backtrace_limit ⇒ Object (readonly)
Returns the value of attribute backtrace_limit.
22 23 24 |
# File 'lib/exception_notifier/td_notifier.rb', line 22 def backtrace_limit @backtrace_limit end |
#custom_param_proc ⇒ Object (readonly)
Returns the value of attribute custom_param_proc.
22 23 24 |
# File 'lib/exception_notifier/td_notifier.rb', line 22 def custom_param_proc @custom_param_proc end |
#database ⇒ Object (readonly)
Returns the value of attribute database.
22 23 24 |
# File 'lib/exception_notifier/td_notifier.rb', line 22 def database @database end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
22 23 24 |
# File 'lib/exception_notifier/td_notifier.rb', line 22 def table_name @table_name end |
Instance Method Details
#call(exception, options = {}) ⇒ Object
24 25 26 |
# File 'lib/exception_notifier/td_notifier.rb', line 24 def call(exception, = {}) TD.event.post(@table_name, exception_to_td_data(exception, )) end |