Class: LoggerFacade::Plugins::Airbrake
- Inherits:
-
Object
- Object
- LoggerFacade::Plugins::Airbrake
- Defined in:
- lib/logger_facade/plugins/airbrake.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #configure(&block) ⇒ Object
- #debug(logger, message) ⇒ Object
- #error(logger, message) ⇒ Object
- #info(logger, message) ⇒ Object
-
#initialize(environment = nil) ⇒ Airbrake
constructor
A new instance of Airbrake.
- #is_debug ⇒ Object
- #trace(logger, message) ⇒ Object
- #warn(logger, message) ⇒ Object
Constructor Details
#initialize(environment = nil) ⇒ Airbrake
Returns a new instance of Airbrake.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 9 def initialize(environment = nil) @name = "LoggerFacade::Plugins::Airbrake" @environment = environment.to_s ::Airbrake.configure do |config| config.host = nil config.port = 80 config.secure = config.port == 443 config.async = true config.development_environments = %w(development test) end end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
7 8 9 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 7 def environment @environment end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 7 def name @name end |
Instance Method Details
#configure(&block) ⇒ Object
22 23 24 25 26 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 22 def configure(&block) ::Airbrake.configure do |config| yield config end end |
#debug(logger, message) ⇒ Object
36 37 38 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 36 def debug(logger, ) # do nothing end |
#error(logger, message) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 48 def error(logger, ) return unless valid_config if .is_a? Exception notify_exception(, logger) else notify_error_log(, logger) end end |
#info(logger, message) ⇒ Object
40 41 42 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 40 def info(logger, ) # do nothing end |
#is_debug ⇒ Object
28 29 30 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 28 def is_debug false end |
#trace(logger, message) ⇒ Object
32 33 34 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 32 def trace(logger, ) # do nothing end |
#warn(logger, message) ⇒ Object
44 45 46 |
# File 'lib/logger_facade/plugins/airbrake.rb', line 44 def warn(logger, ) # do nothing end |