Class: Rollbar::LoggerProxy
- Inherits:
-
Object
- Object
- Rollbar::LoggerProxy
- Defined in:
- lib/rollbar/logger_proxy.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(object) ⇒ LoggerProxy
constructor
A new instance of LoggerProxy.
- #log(level, message) ⇒ Object
- #warn(message) ⇒ Object
Constructor Details
#initialize(object) ⇒ LoggerProxy
Returns a new instance of LoggerProxy.
5 6 7 |
# File 'lib/rollbar/logger_proxy.rb', line 5 def initialize(object) @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
3 4 5 |
# File 'lib/rollbar/logger_proxy.rb', line 3 def object @object end |
Instance Method Details
#debug(message) ⇒ Object
9 10 11 |
# File 'lib/rollbar/logger_proxy.rb', line 9 def debug() log('debug', ) end |
#error(message) ⇒ Object
21 22 23 |
# File 'lib/rollbar/logger_proxy.rb', line 21 def error() log('error', ) end |
#info(message) ⇒ Object
13 14 15 |
# File 'lib/rollbar/logger_proxy.rb', line 13 def info() log('info', ) end |
#log(level, message) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rollbar/logger_proxy.rb', line 25 def log(level, ) unless Rollbar.configuration.enabled && acceptable_levels.include?(level.to_sym) return end @object.send(level, ) rescue StandardError puts "[Rollbar] Error logging #{level}:" puts "[Rollbar] #{}" end |
#warn(message) ⇒ Object
17 18 19 |
# File 'lib/rollbar/logger_proxy.rb', line 17 def warn() log('warn', ) end |