Class: Tablexi::Logger
- Inherits:
-
Object
- Object
- Tablexi::Logger
- Includes:
- Severities
- Defined in:
- lib/tablexi/logger.rb,
lib/tablexi/logger/railtie.rb,
lib/tablexi/logger/rollbar.rb,
lib/tablexi/logger/version.rb,
lib/tablexi/logger/standard.rb,
lib/tablexi/logger/new_relic.rb,
lib/tablexi/logger/severities.rb,
lib/tablexi/logger/option_filter/humanize_request.rb
Defined Under Namespace
Modules: OptionFilter, Severities Classes: Railtie, Standard
Constant Summary collapse
- Rollbar =
lambda do |error, | ::Rollbar.error(error, ) end
- VERSION =
"1.2.0"
- NewRelic =
lambda do |error, | ::NewRelic::Agent.notice_error(error, ) end
Constants included from Severities
Instance Attribute Summary collapse
-
#handlers ⇒ Object
readonly
Returns the value of attribute handlers.
-
#option_filters ⇒ Object
readonly
Returns the value of attribute option_filters.
Instance Method Summary collapse
- #handle(severities, &block) ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
49 50 51 52 |
# File 'lib/tablexi/logger.rb', line 49 def initialize @option_filters = [] @handlers = Hash.new { |h, k| h[k] = [] } end |
Instance Attribute Details
#handlers ⇒ Object (readonly)
Returns the value of attribute handlers.
47 48 49 |
# File 'lib/tablexi/logger.rb', line 47 def handlers @handlers end |
#option_filters ⇒ Object (readonly)
Returns the value of attribute option_filters.
46 47 48 |
# File 'lib/tablexi/logger.rb', line 46 def option_filters @option_filters end |
Instance Method Details
#handle(severities, &block) ⇒ Object
54 55 56 57 58 |
# File 'lib/tablexi/logger.rb', line 54 def handle(severities, &block) raise ArgumentError, "Missing block argument" unless block_given? Array(severities).each { |severity| handlers[severity] << block } end |