Module: Brpoplpush::RedisScript::Logging
- Defined in:
- lib/brpoplpush/redis_script/logging.rb
Overview
Utility module for reducing the number of uses of logger.
Class Method Summary collapse
Instance Method Summary collapse
-
#log_debug(message_or_exception = nil) {|String, Exception| ... } ⇒ void
Logs a message at debug level.
-
#log_error(message_or_exception = nil) {|String, Exception| ... } ⇒ void
Logs a message at error level.
-
#log_fatal(message_or_exception = nil) {|String, Exception| ... } ⇒ void
Logs a message at fatal level.
-
#log_info(message_or_exception = nil) {|String, Exception| ... } ⇒ void
Logs a message at info level.
-
#log_warn(message_or_exception = nil) {|String, Exception| ... } ⇒ void
Logs a message at warn level.
-
#logger ⇒ Logger
A convenience method for using the configured gem logger.
Class Method Details
.included(base) ⇒ Object
9 10 11 |
# File 'lib/brpoplpush/redis_script/logging.rb', line 9 def self.included(base) base.send(:extend, self) end |
Instance Method Details
#log_debug(message_or_exception = nil) {|String, Exception| ... } ⇒ void
This method returns an undefined value.
Logs a message at debug level
33 34 35 36 |
# File 'lib/brpoplpush/redis_script/logging.rb', line 33 def log_debug( = nil, &block) logger.debug(, &block) nil end |
#log_error(message_or_exception = nil) {|String, Exception| ... } ⇒ void
This method returns an undefined value.
Logs a message at error level
75 76 77 78 |
# File 'lib/brpoplpush/redis_script/logging.rb', line 75 def log_error( = nil, &block) logger.error(, &block) nil end |
#log_fatal(message_or_exception = nil) {|String, Exception| ... } ⇒ void
This method returns an undefined value.
Logs a message at fatal level
89 90 91 92 |
# File 'lib/brpoplpush/redis_script/logging.rb', line 89 def log_fatal( = nil, &block) logger.fatal(, &block) nil end |
#log_info(message_or_exception = nil) {|String, Exception| ... } ⇒ void
This method returns an undefined value.
Logs a message at info level
47 48 49 50 |
# File 'lib/brpoplpush/redis_script/logging.rb', line 47 def log_info( = nil, &block) logger.info(, &block) nil end |
#log_warn(message_or_exception = nil) {|String, Exception| ... } ⇒ void
This method returns an undefined value.
Logs a message at warn level
61 62 63 64 |
# File 'lib/brpoplpush/redis_script/logging.rb', line 61 def log_warn( = nil, &block) logger.warn(, &block) nil end |
#logger ⇒ Logger
A convenience method for using the configured gem logger
20 21 22 |
# File 'lib/brpoplpush/redis_script/logging.rb', line 20 def logger Brpoplpush::RedisScript.logger end |