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, | ::.error(error, ) end
- VERSION =
"1.1.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.
47 48 49 50 |
# File 'lib/tablexi/logger.rb', line 47 def initialize @option_filters = [] @handlers = Hash.new { |h, k| h[k] = [] } end |
Instance Attribute Details
#handlers ⇒ Object (readonly)
Returns the value of attribute handlers.
45 46 47 |
# File 'lib/tablexi/logger.rb', line 45 def handlers @handlers end |
#option_filters ⇒ Object (readonly)
Returns the value of attribute option_filters.
44 45 46 |
# File 'lib/tablexi/logger.rb', line 44 def option_filters @option_filters end |
Instance Method Details
#handle(severities, &block) ⇒ Object
52 53 54 55 56 |
# File 'lib/tablexi/logger.rb', line 52 def handle(severities, &block) raise ArgumentError, "Missing block argument" unless block_given? Array(severities).each { |severity| handlers[severity] << block } end |