module SidekiqUniqueJobs::Script::Logging
Utility module for reducing the number of uses of logger.
@author Mikael Henriksson <mikael@mhenrixon.com>
Public Class Methods
Source
# File lib/sidekiq_unique_jobs/script/logging.rb, line 9 def self.included(base) base.send(:extend, self) end
Public Instance Methods
Source
# File lib/sidekiq_unique_jobs/script/logging.rb, line 33 def log_debug(message_or_exception = nil, &block) logger.debug(message_or_exception, &block) nil end
Logs a message at debug level
@param [String, Exception] message_or_exception the message or exception to log
@return [void]
@yield [String, Exception] the message or exception to use for log message
Source
# File lib/sidekiq_unique_jobs/script/logging.rb, line 75 def log_error(message_or_exception = nil, &block) logger.error(message_or_exception, &block) nil end
Logs a message at error level
@param [String, Exception] message_or_exception the message or exception to log
@return [void]
@yield [String, Exception] the message or exception to use for log message
Source
# File lib/sidekiq_unique_jobs/script/logging.rb, line 89 def log_fatal(message_or_exception = nil, &block) logger.fatal(message_or_exception, &block) nil end
Logs a message at fatal level
@param [String, Exception] message_or_exception the message or exception to log
@return [void]
@yield [String, Exception] the message or exception to use for log message
Source
# File lib/sidekiq_unique_jobs/script/logging.rb, line 47 def log_info(message_or_exception = nil, &block) logger.info(message_or_exception, &block) nil end
Logs a message at info level
@param [String, Exception] message_or_exception the message or exception to log
@return [void]
@yield [String, Exception] the message or exception to use for log message
Source
# File lib/sidekiq_unique_jobs/script/logging.rb, line 61 def log_warn(message_or_exception = nil, &block) logger.warn(message_or_exception, &block) nil end
Logs a message at warn level
@param [String, Exception] message_or_exception the message or exception to log
@return [void]
@yield [String, Exception] the message or exception to use for log message
Source
# File lib/sidekiq_unique_jobs/script/logging.rb, line 20 def logger SidekiqUniqueJobs::Script.logger end
A convenience method for using the configured gem logger
@see Script#.logger
@return [Logger]