Module: Observed::Logging
Instance Method Summary collapse
-
#log_debug(message) ⇒ Object
Log the debug message through the logger configured via the :logger attribute.
-
#log_error(message) ⇒ Object
Log the error message through the logger configured via the :logger attribute.
-
#log_info(message) ⇒ Object
Log the info message through the logger configured via the :logger attribute.
-
#log_warn(message) ⇒ Object
Log the warn message through the logger configured via the :logger attribute.
-
#logging_enabled? ⇒ Boolean
‘true` if a value is set for the attribute :logger.
Methods included from Configurable
#configure, #get_attribute_value, #has_attribute_value?, included, #initialize
Instance Method Details
#log_debug(message) ⇒ Object
Log the debug message through the logger configured via the :logger attribute
18 19 20 |
# File 'lib/observed/logging.rb', line 18 def log_debug() logger.debug if logging_enabled? end |
#log_error(message) ⇒ Object
Log the error message through the logger configured via the :logger attribute
36 37 38 |
# File 'lib/observed/logging.rb', line 36 def log_error() logger.error if logging_enabled? end |
#log_info(message) ⇒ Object
Log the info message through the logger configured via the :logger attribute
24 25 26 |
# File 'lib/observed/logging.rb', line 24 def log_info() logger.info if logging_enabled? end |
#log_warn(message) ⇒ Object
Log the warn message through the logger configured via the :logger attribute
30 31 32 |
# File 'lib/observed/logging.rb', line 30 def log_warn() logger.warn if logging_enabled? end |
#logging_enabled? ⇒ Boolean
Returns ‘true` if a value is set for the attribute :logger.
12 13 14 |
# File 'lib/observed/logging.rb', line 12 def logging_enabled? has_attribute_value? :logger end |